

You can also use ListBox as popup

Posted by Sujit Kumar on May 18, 2009


You can also use ListBox as popup

Posted in .NET, asp.net | Tagged: popupcontrolextender as dropdownlilst | 1 Comment »
Posted by Sujit Kumar on January 20, 2009
you can download sql server 2008 express with management studio express editions
link:
Posted in .NET, sql server | Leave a Comment »
Posted by Sujit Kumar on December 31, 2008

Posted in .NET | Tagged: using | Leave a Comment »
Posted by Sujit Kumar on December 31, 2008
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.
Posted in asp.net | Tagged: keep entered value in password textbox in asp.net after postback | Leave a Comment »
Posted by Sujit Kumar on November 14, 2008
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”
Posted in .NET | Tagged: A potentially dangerous Request, asp.net | Leave a Comment »
Posted by Sujit Kumar on November 1, 2008
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”
Posted in .NET | Tagged: pass multiple query string using HyperLinkField in Gridview | 1 Comment »
Posted by Sujit Kumar on October 3, 2008
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:
Posted in asp.net | Tagged: asp.net, C# | Leave a Comment »