passing values from html to serverside for calculation,string-concatenation etc

{ Posted on 10/20/2009 06:09:00 PM by Silvercode }
Tags :
In Some cases we need to pass values from aspx page to aspx.vb or aspx.cs page for alternating values, calculation etc (according to the scenario of the program) to display in the html page


<@asp:TextBox ID="txtname" runat="server" Text='<%# GetStatus(DataBinder.Eval(Container.DataItem, "status" )) %>' >

Declare a public funtion called GetStatus:
Here status value from the database is of type integer, so declare the same integer type in the function
Public Function GetStatus(ByVal type As Integer) As String
Dim ret As String = ""
Select Case type
Case 0
ret = "Complaints"
Case 1
ret = "Enquiry"
Case 2
ret = "Suggestions"
Case 3
ret = "Comments"
End Select

GetStatus = ret
End Function

No Response to "passing values from html to serverside for calculation,string-concatenation etc"

Post a Comment