RSS

How to Register and Call the Client Side Script

- We can register and call the Javascript while the page load event using the 'Page.ClientScript.RegisterStartupScript()' method.
-If you want intimate some inforamtion before user viewing the page we can use this kind of Ajax style javascript calling.

Setps
1. Create a Javascript eighter in design page or inline javascript string for calling the RegisterStartupScript method.
2. Write the Page Load event and use the page.ClientScript.RegisterStartupScript.
example:


function SetPanelHeight(gvCellMaster) {
if (document.getElementById(gvCellMaster) != null) {
if (document.getElementById(gvCellMaster).clientHeight > 410) {
document.getElementById('gvCellMaster').style.height = "410px";
}
}
}
//In Code behind Page( i.e .cs page) of the Page Load event
//This bellow function calls the Javascript of SetPanelHeight
//Change the Grid
protected void page_Load(object sender, EventArgs e) {
string jscript = "";
jscript = "";
Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", jscript);
}

read comments Read User's Comments

Creating Negative Identity Column

We can creating the Negative Identity Column in SQL server
- We can create a nagative Identity and the negative seed values for the the Identity column.


Create Table Emp
(
RecID int Not NULL IDENTITY (-100,-1),
Name Varchar(30)
)

-- To insert the value to Table:
Insert into EMP(Name)
SELECT 'Siva'
Union ALL
SELECT 'Kannan'
Union ALL
SELECT 'Krishna'
Union ALL
SELECT 'Devi'
Go
SELECT * FROM EMP


Result
------
-100 Siva
-101 Kannan
-102 Krishna
-103 Devi

read comments Read User's Comments