Posted by: viralsarvaiya on: November 24, 2009
first of all create class file named ‘basepage.vb’ and add this code to class file
then after inherit this class file from page
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim stringWriter As New System.IO.StringWriter
Dim htmlWriter As New HtmlTextWriter(stringWriter)
MyBase.Render(htmlWriter)
Dim html As String = stringWriter.ToString()
Dim StartPoint As Integer = html.IndexOf(“<input type=””hidden”” name=””__VIEWSTATE”””)
If StartPoint >= 0 Then
Dim EndPoint As Integer [...]
Posted by: viralsarvaiya on: November 21, 2009
Date and time format strings are used to specify which formatting to apply when a datetime data type is represented as a string.
Date and time format strings fall into either standard or custom format strings. Standard datetime format strings are those that the framework has predefined for commonly used datetime patterns, while custom datetime format [...]
Posted by: viralsarvaiya on: November 18, 2009
Windows Communication Foundation (WCF) is the latest service execution environment from Microsoft that enables you to seamlessly expose CLR types as services and consume services as CLR types. WCF is a unified programming model that combines the best of breed features from XML Web Services, .NET Remoting, MSMQ, and COM+ into an integrated platform that [...]
Posted by: viralsarvaiya on: November 10, 2009
To get HTML of web page you need only few lines of code.
To start, place two TextBox controls named txtURL and txtPageHTML, and one button control on web form, like in image bellow:
Now, on button’s click event function, place this code:
[ C# ]
// We need these namespaces
using System;
using System.Text;
using System.Net;
public partial [...]
Posted by: viralsarvaiya on: November 4, 2009
I had been searching for a way to merge cells in a GridView
If e.Row.DataItemIndex % 2 = 0 Then
e.Row.Cells(0).RowSpan = 2
e.Row.Cells(1).RowSpan = 2
End If
‘Remove the extra cells created due to row span for odd rows
If e.Row.DataItemIndex % 2 = 1 Then
e.Row.Cells.RemoveAt(0)
e.Row.Cells.RemoveAt(0)
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
End If
This code should take every cell in the first and second columns [...]
Posted by: viralsarvaiya on: November 2, 2009
All the hype that once surrounded XML is finally starting to die down, and developers are really beginning to harness the power and flexibility of the language. XML is a data descriptive language that uses a set of user-defined tags to describe data in a hierarchically-structured format.
The release of Microsoft SQL Server 2000 a couple [...]
Posted by: viralsarvaiya on: October 30, 2009
Steps.
1) Create Simple Web Application.
2) put the below control in to the page (.aspx)
2.1) GridView (id= GridView1)
2.2) Button (id=button1 and Text =Create CSV File)
3) assign data source to GridView
4) on the button_click event put the following code.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
‘Create CSV file
Dim objSw As New StreamWriter(Server.MapPath(“~/demo.csv”))
‘get table from GridView1
Dim [...]
Posted by: viralsarvaiya on: October 28, 2009
I have one CheckBoxList control that binds values at runtime from the database, and when I click on a button from the page, I want to get the values (Database Primary Key) from the CheckBoxList, but for the checked checkboxes only.
Here is the code, what I have achieved so far. This code works fine with [...]
Posted by: viralsarvaiya on: October 27, 2009
take a element of Div
<div id=”contentmsg” style=”position: absolute; right:25%; width: 100px; height:100px;visibility: hidden;”>
<img src=”images/loading.gif” width=”50px” height=”50px” />
</div>
suppose we have a dropdown and according to onchange() event this div is visible or hide,
<asp:DropDownList ID=”ddlparavalue” runat=”server”></asp:DropDownList>
in the server side bind the dropdownlist dynamically and add the attribultes as below
ddlparavalue.Attributes.Add(“onchange”, “javascript:void HideOrVisibleDDL();”)
in the head of the html section [...]
Recent Comments