<script language=”javascript” type=”text/javascript”>
alert(“MultiLine Alert” + ‘n’ + ” This will Start From New Line”);
</script>
<script language=”javascript” type=”text/javascript”>
alert(“MultiLine Alert” + ‘n’ + ” This will Start From New Line”);
</script>
Write The folloeing Javascript
function NumericOnly()
{
var key = window.event.keyCode;
if((key < 46 || key > 57))//|| key != 46)
window.event.returnValue = false;
}
And Call NumericOnly() javascript funvtion on Key Press of TextBox
<asp:TextBox ID=”txtPhone” runat=”server” OnKeyPress=”NumericOnly()” MaxLength=”14″></asp:TextBox>
–Declare Two Variable
–One For Comma Sepearated Value and the Other For Query
declare @test nvarchar(4000)
declare @values nvarchar (200)
–Tale your Comma seperated value i.e. 14,16,3,18 in @@values
set @values=(Select left(Empid,Len(EmpId)-1) as EmployeeId from TableName Where ColumnName=4)
–Add that @values in Test Which is nvarchar Qoery
set @test=’select * from Employee where EmployeeId in (‘+ (@values)+’)’
— Finally Execute that @test Query
EXEC(@test)
In Short
declare @test nvarchar(4000)
declare @values nvarchar (200)
set @values=(Select left(Empid,Len(EmpId)-1) as EmployeeId from TableName Where ColumnName=4)
set @test=’select * from Employee where EmployeeId in (‘+ (@values)+’)’
EXEC(@test)
Simple Example of Employee Id remoce Last Character
If u have a like Empid like
14,8,16,19,1,18, and you want to remove Last character i.e ‘,’
Sql Query :
Select left(Empid,Len(EmpId)-1) as EmployeeId from TableName
Open the following link from regedit commnad
Than Delete file1 from the right side pane
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio \8.0\ProjectMRUList
To Disable Back Button of Browser on User Signout put this script in Signout button’s Page .
window.history.forward(1);
And if you need this functionality in Firefox also than add the following line .
-<META HTTP-EQUIV=”PRAGMA” CONTENT=”NO-CACHE”>-
-<META HTTP-EQUIV=”Expires” content=”-1″>-
-<META HTTP-EQUIV=”CACHE-CONTROL” CONTENT=”NO-STORE”>-
Server.Transfer v/s Response.Redirect
Response.Redirect involves a roundtrip to the server whereas Server.Transfer conserves server resources by avoiding the roundtrip.
It just changes the focus of the webserver to a different page and transfers the page processing to a different page.
Response.Redirect can be used for both .aspx and html pages whereas Server.Transfer can be used only for .aspx pages
and is specific to ASP and ASP.NET.
With Response.Redirect you can redirect the user to the both type of pages .html or .aspx like below,Response.Redirect(“mypage.html”) OR Response.Redirect(“OtherPage.aspx”) But in case of Server.Transfer you can only work with .asp or .aspx page like below
Server.Transfer(“mypage.asp”) OR Server.Transfer(“OtherPage.aspx”)
Response.Redirect can be used to redirect a user to an external websites. Server.Transfer can be used only on sites running on the same server.
You cannot use Server.Transfer to redirect the user to a page running on a different server.
This is the Query of Login Case Sensitive validation
SELECT * FROM Employee
WHERE
BINARY_CHECKSUM(login) = BINARY_CHECKSUM(‘” + TxtUsername.Text + “‘)
AND
BINARY_CHECKSUM(password) = BINARY_CHECKSUM(‘” + TxtPwd.Text + “‘)
Write This Code in Page’s Page_PreInit
void Page_PreInit(Object sender, EventArgs e)
{
if(Session[“masterpage”] != null)
{
this.MasterPageFile = (String) Session[“masterpage”];
}
}
How to open Child Window From Parent Page and Close that Child window on Grid Editing and Use that Value in Parent Page.
Put this Javascript on button’s onClientSxript event
OnClientClick=”ViewAllHelp();”
function ViewAllHelp()
{ window.showModalDialog(‘frmViewEmployeeMaster.aspx’,’name’,’dialogHeight:417px; dialogWidth:800px; scroll:yes; status:no;location:no;’);
}
And in form ViewAll put this line in Html Tag
<base target=”_self”></base>
Now you can fill Gridview for records and in Gridview Edit Operation you can close that modal Dialog Form from the following Code
protected void dg_RowEditing(object sender, GridViewEditEventArgs e)
{
Label lblid = new Label();
lblid.Text = ((Label)dg.Rows[e.NewEditIndex].FindControl(“id”)).Text.ToString();
Session[“SearchId”]=lblid.Text.ToString();
ClientScript.RegisterClientScriptBlock(typeof(string), “closing”, “<script>window.close();</script>”);
}
And by using that session you can Use that value in Parent Page.