

You can also use ListBox as popup



You can also use ListBox as popup

you can disable default button on a webform set to false of button property “UseSubmitBehavior” .
ex:
<asp:Button ID=”btnSave” runat=”server” Text=”Save” CssClass=”buttons” UseSubmitBehavior=”false” />
you can download sql server 2008 express with management studio express editions
link:
right click of mouse button and select organize using menu from contextmenu.
here you can sort and delete unused namespace.

keep the value of password textbox after postback while textbox TextMode properties is “Password”
add this line on page_load event
txtPassword.Attributes.Add(“value”,txtPassword.Text);
It will keep text of password textbox while page will go for postback on server.
This error occurs when we try to post html code from code behind.
The reason behind it server always validate the posted data, if it find that its an HTML code, error will occues like ‘A potentially dangerous Request.Form value…’.
if you want to send html data then you hvae to write {validateRequest=”false”} in page directive
ex:
AutoEventWireup=”true” ValidateRequest=”false”
You can pass single/multiple query string using HyperLInkField
Pass data field name in DataNavigateUrlFields which you wnat to pass value in query string
ex:
DataNavigateUrlFields=”subject,query”
here subject and query both are differenct data field those are comming from database.
and write the page name in DataNavigateUrlFormatString where you want to pass query string value.
ex:
DataNavigateUrlFormatString = “~/Pages/default.aspx?UserName={0}&GameTitle={1}”
asp:HyperLinkField HeaderText=”View Details” DataNavigateUrlFields=”subject,query” DataNavigateUrlFormatString = “~/Pages/default.aspx?UserName={0}&GameTitle={1}” Text=”View”
Show Image from SQL Server in ASP.NET Using C#
SqlConnection objConnection;
SqlCommand objCommand;
SqlDataAdapter objAdapter;
DataSet objDS=new DataSet();
using (objConnection = new SqlConnection(“server=sujitkumar\\sqlexpress;database=livechat;uid=sa;pwd=1234″))
{
objConnection.Open();
using (objCommand = new SqlCommand())
{
objCommand.Connection = objConnection;
objCommand.CommandType = CommandType.Text;
objCommand.CommandText = “select img_online from image_master”;
objAdapter = new SqlDataAdapter(objCommand);
objAdapter.Fill(objDS, “CustomerAttributes”);
}
objConnection.Close();
}
MemoryStream stream = new MemoryStream();
byte[] image = (byte[])objDS.Tables[0].Rows[0][0];
Response.ContentType = “image/jpeg”;
Response.Expires = 0; Response.Buffer =true;
Response.Clear();
Response.BinaryWrite(image);
Response.End();
The above code will write image on the page.
You can show this image in any image button or image control like: