|
for eg:
function A()
{
alert("Hai");
}
In C# button onclick event = ?????????????????????????
please help me
|
|
|
|
|
Please don't ask twice.
You can't call javascript from C#, if you think that should be possible, you need to understand the ASP.NET framework a little better. The C# has stopped running when thye page is rendered.
However, you can use RenderClientScriptBlock to inject script into a page from C#, and then that script, if it's global, will run when they page loads. Or, if it's a function, as you show here, it gets injected into the page. You do need to add <script> blocks, there's nothing intelligent about the method.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Is there a reason you wanted to put javascript in the c#?
Obviously C# code runs at the server end and javascript at the client end.
You can design msg boxes for c# I think if thats what you are trying to achieve
|
|
|
|
|
See the double-post below
|
|
|
|
|
Perhaps on slow connection, they keep submitting it. I feel that the duplicate post detector should flag such closely resembling posts too.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
*Looks at each*
<br />
for eg:<br />
<br />
function A()<br />
{<br />
alert("Hai");<br />
}<br />
<br />
In C# button onclick event = ????????????????????????? <br />
<br />
please help me
vs
<br />
for eg:<br />
<br />
function A()<br />
{<br />
alert("Hai");<br />
}<br />
<br />
In C# button onclick event = ?????????????????????????<br />
<br />
please help me
Closely resembling? I'd say identical....
- Reelix
Update:
Ok, 1 has his name...
|
|
|
|
|
button1.attribute.add('OnClick','return a();');
|
|
|
|
|
try this ....
protected void Button1_Click(object sender, EventArgs e)
{
string javaScript = "\n" + "A();" +"";
ClientScript.RegisterStartupScript(this.GetType(), "Run_it", javaScript);
}
|
|
|
|
|
for eg:
function A()
{
alert("Hai");
}
In C# button onclick event = ?????????????????????????
please help me
G Nathan
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
Button1.OnClientClick = "javascript:alert('Booya!'); return false;";<br />
}
- Reelix
|
|
|
|
|
It doesnt work out at all. i m using master page. can it work in master page. it only works in page load event. i need this into a button click event
G Nathan
|
|
|
|
|
Hi
Friends
I have developed a web site ..which is appearing good in I.E but not in Mozilla please tell me what to do ?
this is the link for reference:
http://www.rakshanllc.com/webbooking/default.aspx[^]
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
ALT + F4 wrote: Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
Not sure what this means....
It means that you need to read on the differences in how the same HTML can render in different browsers, and redesign your site so it renders fine in both
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
CG ....
I hope you have gone through the link with both browsers ....please help me to sort out this problem...
Thank you
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
|
I've had enough hell doing this for my websites. I hate CSS
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You are typically running into a cross-browser compatible stylesheet issue.
ALT + F4 wrote: Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
I believe you are trying to support 'Smart Working' philosophy instead of 'Hard Working'.
ALT + F4 wrote: ALT + F4
If a little research to cross browser compatibility does not work, your nick name is also an alternative solution which can be applied to the browser window.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
my nick name not only works for browsers ..it also works for humans.....joking
i am new to asp.net yaar ...try to understand and give smart answers ...
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
ALT + F4 wrote: i am new to asp.net yaar ...try to understand and give smart answers ...
Nothing to hurt. It was just to be a bit humourous.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello,
After achievement of my asp.net project in my localhost PC, i need to put it in the internet.Do someone help how to make that and what are the steps for doing that.
thanks regards
Best regards
dghdfghdfghdfghdgh
|
|
|
|
|
|
ellllllllie wrote: i need to put it in the internet
love the wording!
You need a web server to put your website on
A registered URL for so people can type in an address and find it.
Lots of companies provide website hosting and also good deals on buying a domain name
|
|
|
|
|
.netman wrote: You need a web server to put your website on
A registered URL for so people can type in an address and find it.
Lots of companies provide website hosting and also good deals on buying a domain name
Aren't these responsibilities of a system administration team? As a developer, the focus should be between BOX (LOCAL) to BOX (ON THE INTERNET). What do you say?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Vasudevan Deepak K wrote: Aren't these responsibilities of a system administration team?
Yeah that is a good point, although in a small company or even if this person is freelance then the responsibility falls on them to choose server, domain name etc.
The article you pointed them to was useful though.
Another point to add is that you will need a suitable FTP to upload the project to the server
|
|
|
|
|
.netman wrote: suitable FTP
That is correct. Alternate modes are FrontPage, WebDAV. I admit these are a little vulnerable and need to protected with additional permissions. I prefer Leech FTP. It is no more supported by the author but you can grab a download easily from many websites. It is multi-threaded, password protection on batch operations and many more.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|