|
Is it possible to write javascript on a server control...?
|
|
|
|
|
Sure, you can call javascript code for server side controls.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i try to write javascript on onclick of that button..but it gives error..like' ")" expected '. what is the easiest way to do that?
i have 2 textboxes & 1 button (all server controls). when user clicks the button ..two confirm window appears after one another.In the first window if we click ok ..it display another confirm window and if click cancel it stays as it is. what is d easiest way to do this.?
|
|
|
|
|
It depends on what code you have written in click event of that button. And about the error that is because some systax error in your javascript.
Best Regards,
Apurva Kaushal
|
|
|
|
|
yes..but how to make it possible to display another confirm window on ok click of first confirm window?
|
|
|
|
|
Why do you want to display two confirm window. Whatever validation you want you can do at one go and display the message later.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Can you post the code which you have written ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
yes..but how to make it possible to display another confirm window on ok click of first confirm window?
|
|
|
|
|
Yes you can do that see the fallowing javascript code i don't know is it the proper way or not
<br />
function getddValues()<br />
{<br />
<br />
if( confirm("Something to do "))<br />
{<br />
if(confirm("In OK Click "))<br />
{ <br />
alert(" Here will be your code ");<br />
}<br />
}<br />
else<br />
{<br />
alert(" Cancel Selected");<br />
<br />
}<br />
}<br />
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Thanks..i will try that...
|
|
|
|
|
You are Welcome the King
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
yes ..it is working..i am putting it in my code..thanks once again..hum dil ke raja hai bhai..vaise to gali ka kutta bhi hame janta nahi.
|
|
|
|
|
Hum bhi waise hi bhai
Kaha se ho ? i am sandeep from Maharashtra but working in Hyderabad
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
i am amit from nashik,maharashtra..working in nashik..
|
|
|
|
|
Yes u can.
controlName.Attributes.Add("onclick","return FunationNameOfJavascript();")
Hope it helps u..
|
|
|
|
|
Hi All ,
I am getting this Error when i try to place a CrystalReportviewer on Webform.It is not displaying in my webform.All other controls(Button,Labels etc) are coming Except ReportViewer.
"CrystalDecisions.web.CrystalReportViewer is not defined"
Thanks,
|
|
|
|
|
Hello every body,
I want to use an button in item template of datalist
and i want dat on the click event of button the page should to redirected to the given url.
But i am unable to do dat .
pleae help me
Regards
Rahul
rahul saini
|
|
|
|
|
there is a property of button commandname
set commandname="Button1"
and on the click of the button in itemcommand event of the datalist you can trace the button by its command name and can code accordingly.
|
|
|
|
|
Hi Ravi
Thanks for rplying my post.
Can u send me an example of dis.
I am not getting ur point.
I have assigned commandname.
but wat to do next....
Please send me an example with code
Thanks
Rahul
rahul saini
|
|
|
|
|
in the vb file
<br />
Private Sub datalist1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles datalist1.ItemCommand<br />
if e.commandname = "button1" then<br />
response.redirect("xyz.aspx")<br />
endif<br />
end sub<br />
|
|
|
|
|
Hi Ravi
It is not working.
I have use following code in .aspx
<asp:datalist id="veiwJobDetails" runat="server" onItemCommand = "button_command">
<ItemTemplate>
<asp:Button ID="apply" Runat="server" CommandName="applyVacancy"></asp:Button>
</ItemTemplate>
</asp:datalist>
I have use following code in .vb
Sub button_command(ByVal source As Object, ByVal e As DataListCommandEventArgs) Handles veiwJobDetails.ItemCommand
If e.CommandName = "applyVacancy" Then
Response.Redirect("wwww.jjjjdddd.com")
End If
End Sub
But it not redirecting to dat url
It is redirecting to the same page.
Regards
Rahul
rahul saini
|
|
|
|
|
write below code in your aspx page
<br />
<br />
<html><br />
<head><br />
<meta http-equiv="pragma" content="no-cache"><br />
<base target="_self"><br />
<head><br />
<html><br />
in vb you have done all the things properly..
|
|
|
|
|
Hi
Give a method name for the onclick event of Button. You can add code behind for that button event. For example
protected void Button1_Onclick(object sender, EventArgs e)
{
Response.Redirect("Default2.aspx");
}
Make sure that in your .aspx you have added OnClick event for the button. Method name can be anything but should be same as the code behind file.
Hope this is clear.
Harini
|
|
|
|
|
Hello Harini,
Thanks for ur rply.
But my button is in itemList in dataList.
Thanks
Rahul
rahul saini
|
|
|
|
|
You can use the method what ravijjain has suggested.
Best Regards,
Apurva Kaushal
|
|
|
|