Vb.net
In this post, I will explain how you can pass parameter to the dynamically added (from code behind) User Control. Most of you might aware of how we can achieve this in web application project. Following is the code for that 1: Dim objCon As Control = Page.LoadControl("~/Control... 2: Ctype(objCon,MyControl).Pro... = "Test" 3: Ctype(objCon,MyControl).Pro... = "USAM" 4: MyPanel.Controls.add(objCon) Now what if you have a web site project which does not have the pre-compiled ......
In this post I will share with you a small code snippet which will help you to get the repeater control output in string variable. 1: Dim sb As New StringBuilder() 2: Dim objHtml As New HtmlTextWriter(New System.IO.StringWriter(sb)) 3: 4: If dt.Rows.Count > 0 Then 5: Repeater1.DataSource = dt 6: Repeater1.DataBind() 7: End If 8: 9: Repeater1.RenderControl(obj... 10: Return sb.ToString() Well, I have used a little trick here. The RenderControl method of repeater control can put all the HTML in ......
The requirement of the day is to extract the name of the columns returned by procedures. Stored Procedures are dynamic that is why we need to create a function that takes Stored Procedure name as parameter and return the column names in string. So here is the quick snippet for that 1: Public Shared Function getMetaData(ByVal spName As String) As String() 2: Dim sqlCon As New SqlConnection(Configuration... 3: sqlCon.Open() 4: 5: Dim sqlCmd As New ......
While using Membership API, It is a very normal task to send user a registration or verification email. We can achieve that using two ways one is using the default email setting of Create User Control and other is by implementing CreateUserWizard.CreatedUser event Method 1: Drag and Drop the create user control, right click then properties and find MailDefination and set appropriate values for each property. BodyFileName is basically the location of the file which contains the body of the email. ......