Fetch All city order by city name:
dataContext _Data= new dataContext();
var qry = from a in _Data.Cities
orderby a.CName
select a;
Tuesday, March 30, 2010
Thursday, March 11, 2010
Wednesday, March 10, 2010
ViewState in asp.net
protected void Page_Load(object sender, EventArgs e)
{
ViewState["id"] =Label1.Text;
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = (Convert.ToInt32(ViewState["id"])+1).ToString();
ViewState["id"] = Label1.Text;
}
{
ViewState["id"] =Label1.Text;
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = (Convert.ToInt32(ViewState["id"])+1).ToString();
ViewState["id"] = Label1.Text;
}
Logout in Asp.net
protected void Page_Load(object sender, EventArgs e)
{
if (Session["id"] == null)
{
Response.Redirect("Default2.aspx");
}
Label1.Text = Session["id"].ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
Session.Abandon();
}
{
if (Session["id"] == null)
{
Response.Redirect("Default2.aspx");
}
Label1.Text = Session["id"].ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
Session.Abandon();
}
Disable Copy And Paste In TextBox Control in asp.net
<script language="javascript">
function copy()
{
alert("Can't copy the text");
return false;
}
function paste()
{
alert("can't paste text");
return false;
}
</script>
<asp:TextBox ID="TextBox2" runat="server" Text="hi" oncopy="return copy();" onpaste="return paste();"></asp:TextBox>
function copy()
{
alert("Can't copy the text");
return false;
}
function paste()
{
alert("can't paste text");
return false;
}
</script>
<asp:TextBox ID="TextBox2" runat="server" Text="hi" oncopy="return copy();" onpaste="return paste();"></asp:TextBox>
Subscribe to:
Posts (Atom)