
lamy
Avatar/Signature-
Posts
56 -
Joined
-
Last visited
About lamy
- Birthday 02/09/1979
Personal Information
-
Occupation
id tell you but then id have to kill you
-
Visual Studio .NET Version
VS 2012
-
.NET Preferred Language
C#, VB.NET
lamy's Achievements
Newbie (1/14)
0
Reputation
-
thanks :)
-
i have a page that sends to a webapi via WebClient which has a DateTime value as one of the parameter, for some reason after serializing it with JavaScriptSerializer it takes -8 out of the value here's what i tested in C# public class MyParam { public string param1 { get; set; } public DateTime param2 { get; set; } } JavaScriptSerializer serializer = new JavaScriptSerializer(); string json = serializer.Serialize(param); // param = MyParam json = serializer.Serialize(json); MyParam test = serializer.Deserialize<MyParam>(json); // less 8 hours of original value
-
i have sets of tags that i wanted to write in my html (specifying where it should be) but i couldnt find the right approach for this atm i made a web control which serves as a place holder, then on my page i find (if its on a master page) the control and assign the content (in a property) while the control (placeholder) overides Render so it gets written to where i placed it any other way to do this? all i wanted to do is write some custom tags like these <html> <form ...> ... </form> <mycustomtag value="set" target="something"/> <mycustomtag value="invoke" target="something_else"/> <mycustomtag value="invoke" target="another"/> <mycustomtag value="terminate" target="true"/> </html> it has no order or whatsoever, itll depend on the conditions that i made. if youre wondering why i needed this its because this page is being read by my winforms application which actually handles the interface (its for a kiosk, the ui for keypads and all those are done in windows control which i invoke if i see those tags) response.write wont do since i cant tell it where to write it, thats why i made that placeholder so i know where i put it, anyone? heres what i have atm my tag writer control <ToolboxData("<{0}:TagWriter runat=""server""></{0}:TagWriter>")> _ Partial Class TagWriter Inherits System.Web.UI.UserControl Private _Content As String = String.Empty <Personalizable()> _ Public Property Content() As String Get Return _Content End Get Set(ByVal value As String) _Content = value End Set End Property Protected Overrides Sub Render(ByVal writer As HtmlTextWriter) writer.Write(_Content) End Sub End Class at code-behind i generate those tags using a class (function returning a string) and assign it to content from my page (load) TagWriter1.Content = "something here" if its on a master page Dim tag As TagWriter = CType(Page.Master.FindControl("tagWriter"), TagWriter) tag.Content = "something here"
-
i dont think itll work, since you did it with response.write, the script was written first before the form was rendered to the page, window.opener.frmMain has no properties to deal with
-
tnx again PlausiblyDamp, i guess ill look at remoting then.
-
got a question PlausiblyDamp, what if i wanted to be notified that i got the request first, and get notified (return the result) when the process is done, like BeginSomething - notify that i received the request (return a value) - (should trigger the process or do the process at the End) EndSomething - process the request - notify that the process is done (return a value) can this be done by this? after reading some articles, it seems that asynchronous would only be like threadingm, or am i wrong. what im trying to accomplish is to return maybe 2 separate results, with the first one as immediate and the other as soon as it finish processing, by just requesting one webservice method? atm, in my application im populating a datatable with all the references from the request, and use it to check the result in a loop, but this is by using 2 webservice method (one to acknowledge the request, and the other to check for result)
-
tnx PlausiblyDamp. ill take a look at that, i guess asynchronous is the way ^^ have any snippets? cant find much on the net im doing everything in .net, my winform application is calling the web method (webservice)
-
im using a webservice to process things and return the result, now im planning to do this - send request via webservice (from client side) - return an acknowledgement (that i received the request) (to client side) and breaks the connection - process it (on server side) - return the process result (to client side) atm, i have these - send request via webservice (from client side) - process it (on server side) and return the result (to client side) my question is, is there a way to push the process result via webservice or process something after i return an acknowledgement to client side?
-
im making an auto-update program which uses a webservice, this webservice does all returning the version of the patch and all that, including the file itself which i return as byte array, its already working when it comes to waiting until it is fully downloaded, what i did is make a structure for both the byte array and the length of the byte array, in my program i loop until the size of the data is the same as the length of the PatchFile Public Structure PatchFile Dim data As Byte() Dim length As Int64 End Structure but doing this sometimes gives me a Not-Responding application, having Nothing on data even if did request for it. is there a better way to return a file webservice or not? :confused: (i know theres clickonce but i already had my codes and this is what all i have left )
-
was trying to add this column after i populate my datatable dt.Columns.Add(New DataColumn("ID", GetType(System.Int16))) dt.Columns("ID").AutoIncrement = True dt.Columns("ID").AutoIncrementSeed = 1000 the column is added but it doesnt show the value after i bind it to a datagrid/gridview anyone havin this same prob? btw, im using VS 2005 Express
-
a colleague asked me if you could insert a datagrid inside a datarepeater, i wasnt sure at that time so i tried searching but was unable to get any info on it, so i tried messin with the repeater events diggin inside watch values heres what i came up with on the page i have the repeater with a datagrid within itemtemplate <asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td> TABLE 1<br /> <%#DataBinder.Eval(Container.DataItem, "ID")%> <%#DataBinder.Eval(Container.DataItem, "NAME")%> </td> <td> TABLE 2 <asp:DataGrid ID="datagrid1" runat="server"> </asp:DataGrid> </td> </tr> <tr> <td colspan="2"> <hr /> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> in my code behind (took off the sqlclass, just the usual anyway) Protected Sub form1_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles form1.Load Dim dt1 As New DataTable("TABLE1") Dim query As String = "" query = "SELECT TOP 10 * ID, [NAME] FROM TABLE1" dt1 = sqlClass.execQuery(query, dt1.TableName) ' returns datatable Repeater1.DataSource = dt1 Repeater1.DataBind() End Sub Protected Sub Repeater1_ItemCreated(ByVal sender As Object, _ ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) _ Handles Repeater1.ItemCreated Dim dt2 As New DataTable("TABLE2") Dim query As String = "" Try ' itemtemplate (can also be checked with ItemType) Dim drv As DataRowView drv = e.Item.DataItem query = "SELECT Something FROM TABLE2 where ID = '" & drv.Row.Item("ID") & "'" dt2 = sqlClass.execQuery(query, dt2.TableName) Dim datagrid1 As DataGrid = DirectCast(e.Item.FindControl("datagrid1"), DataGrid) datagrid1.DataSource = dt2 datagrid1.DataBind() Catch ' headertemplate or footertemplate (do nothing) End Try End Sub is there another way, just curious?
-
this is how i would check it in 2003 <WebMethod()> _ Public Function Test() As String Dim sc As Microsoft.Web.Services.SoapContext = Microsoft.Web.Services.HttpSoapContext.RequestContext If sc Is Nothing Then _ Throw New System.Web.Services.Protocols.SoapException("Only SOAP requests are accepted", _ New System.Xml.XmlQualifiedName("NotSoapCall")) Return "This is a string" End Function in 2005 i would then import Microsoft.Web.Services3 so i could use SoapContext, but theres no HttpSoapContext that can be found anyone?
-
tnx PlausiblyDamp, ill take a look at it.
-
was wondering if id make an API for our vending machine application (connected to the internet), currently we send request and read response directly to our database, for the revamp we would want to make it more secure, but cant decide what to do, was thinking of doing an httpwebrequest or our page (ssl), but we could also do an API (server-client) to make such request/response... which one do you think is faster or is there any other way?
-
thanks Joe Mamma, ill keep that in mind :)