ANAT2403
asked on
Page.ClientScript with master page
In VS2005 ASP.NET 2.0 sqlserver 2000:
I use the following function to show error messages in my site:
public void ShowMessage(string keymsg)
{
string myScript = @"alert('this is my message)";
Page.ClientScript.Register StartupScr ipt(this.G etType(), "MyScript", myScript, true);
}
but when I use it in a slave of a master page, it gives an error.
Do I have to define it in the master page ? and how to call it?
Thankyou
Ant
I use the following function to show error messages in my site:
public void ShowMessage(string keymsg)
{
string myScript = @"alert('this is my message)";
Page.ClientScript.Register
}
but when I use it in a slave of a master page, it gives an error.
Do I have to define it in the master page ? and how to call it?
Thankyou
Ant
>> 'this is my message << needs to be: 'this is my message'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
thats right, i just quickly glanced at the code and was used to ASP.NET 1.1 - which does not have the extra params so you must include the script tag.
ASKER
Jojo1771 is almost correct
this is the solution:
string myScript = @"alert('this is a message');";
the second tag ' in - this is a message I forgot to put here but in my program it existed.
the problem was with the ; sign that I didn't know I have to add
Thankyou all.
this is the solution:
string myScript = @"alert('this is a message');";
the second tag ' in - this is a message I forgot to put here but in my program it existed.
the problem was with the ; sign that I didn't know I have to add
Thankyou all.
hmmm...I don't see any points here
ASKER
because you didn't mention the sign of semicolon ; which was the only problem here.
The closing tag you mention was something I forgot to write in expert exchange but not in the program
The closing tag you mention was something I forgot to write in expert exchange but not in the program
don't you use copy-paste???
{
string myScript = @"<script language='javascript'>aler
Page.ClientScript.Register
}