|
I think you would be better using the cascading dropdown and populating the dropdowns depending on which state they choose
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/CascadingDropDown/CascadingDropDown.aspx
We are not a Code Charity
|
|
|
|
|
hi,
i have used gridview in asp.net 2005 wit c#.i need to update my datas.in tat i hv placed dropdownlist,checkbox controls.but its not updating the datas.when i edit the row,we have dropdownlist but not tat database value.so when i edit the row the database value should be in dropdown list.when i click update link i got this error.The GridView 'GridView1' fired event RowUpdating which wasn't handled.so pls help me to do this.
this is coding
-----------------
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{ GridViewRow gv = null;
string k = string.Format(GridView1.Rows[gv.RowIndex].Cells[4].Text);
Response.Write(k);
TextBox t1, t2, t3, t4, t5,t6,t7,t8,t9,t10,t11;
DropDownList d1, d2, d3, d4,d5;
CheckBox cdr, cdrw, cdvdr, cdvdrw, cfdd, cinter, cwa;
t1 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[5].Controls[1];
t2 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[6].Controls[1];
t3 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[7].Controls[1];
t4 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[8].Controls[1];
t5 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[9].Controls[1];
t6 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[10].Controls[1];
t7 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[11].Controls[1];
t8 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[18].Controls[1];
t9 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[20].Controls[1];
t10 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[21].Controls[1];
t11 = (TextBox)GridView1.Rows[gv.RowIndex].Cells[22].Controls[1];
d1 = (DropDownList)GridView1.Rows[gv.RowIndex].Cells[0].Controls[0];
d2 = (DropDownList)GridView1.Rows[gv.RowIndex].Cells[1].Controls[0];
d3 = (DropDownList)GridView1.Rows[gv.RowIndex].Cells[2].Controls[0];
d4 = (DropDownList)GridView1.Rows[gv.RowIndex].Cells[3].Controls[0];
d5 = (DropDownList)GridView1.Rows[gv.RowIndex].Cells[23].Controls[0];
cdr = (CheckBox)GridView1.Rows[gv.RowIndex].Cells[12].Controls[2];
cdrw = (CheckBox)GridView1.Rows[gv.RowIndex].Cells[13].Controls[2];
cdvdr =(CheckBox)GridView1.Rows[gv.RowIndex].Cells[14].Controls[2]; cdvdrw=(CheckBox)GridView1.Rows[gv.RowIndex].Cells[15].Controls[2];
cfdd = (CheckBox)GridView1.Rows[gv.RowIndex].Cells[16].Controls[2];
cinte =(CheckBox)GridView1.Rows[gv.RowIndex].Cells[17].Controls[2];
cwa = (CheckBox)GridView1.Rows[gv.RowIndex].Cells[19].Controls[2];
int cd_r = 0, cd_rw = 0, dvd_r = 0, dvd_rw = 0, fdd = 0, inter = 0, wa = 0;
if (cdr.Checked)
{ cd_r = 1; }
if (cdrw.Checked==true)
{ cd_rw = 1; }
if (cdvdr.Checked==true)
{ dvd_r = 1; }
if (cdvdrw.Checked == true)
{ dvd_rw = 1; }
if (cfdd.Checked == true)
{ fdd = 1; }
if (cinter.Checked == true)
{ inter = 1; }
if (cwa.Checked == true)
{ wa = 1; }
string upd="update reg_laptop set block='"+d1.SelectedValue+"',location='"+d2.SelectedValue+"',department='"+d3.SelectedValue +"',pcname='"+d4.SelectedValue+"',os='"+t1.Text+"',procmodel='"+t2.Text +"',procspeed='"+t3.Text+"',ram='"+t4.Text+"',harddisk='"+t5.Text+"',cpuno='"+t6.Text +"',monino='"+t7.Text +"',cd_r="+cd_r+",cd_rw="+cd_rw+",dvd_r="+dvd_r +",dvd_rw="+dvd_rw+",fdd="+fdd+",internetconnection="+inter+",dateofpurchase='"+t8.Text+"',waranty_amc="+wa+",frmdate='8/5/2003',todate='8/5/2009',compname='"+d5.SelectedValue+"',contactperson='"+t9.Text+"' where ipaddress='"+k+"'";
cmd = new SqlCommand(upd, con);
cmd.ExecuteNonQuery();
Response.Write("ur datas r updated");
GridView1.EditIndex = -1;
binddata(); }
===========================================================
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) {
GridView1.EditIndex = e.NewEditIndex;
binddata(); }
thank you
k.priya
|
|
|
|
|
how to implent PayPal IPN System in asp.net with c#.
after implementation how can I test.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
To implement paypal ipn you have to write you code on a aspx.vb page. while sending a request to paypal you can pass the page name under notify_url parameter. Paypal will call this page when he got a response about transaction. You can catch the response on that page if the response is verified the make your tasks.
For testing paypal ipn you have to upload your application on server and then you can test it.
Paypal ipn cannot run from local server.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
You should try googling your question, you will probably find a lot of good articles which will help you
We are not a Code Charity
|
|
|
|
|
Did you check out PayPal Developer's Guide first?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
hi friend,
Actually i m developing online exam application in asp.net and i want time is display when user start exam but time is not reducing when exam is start i mean if suppose for one exam time is 10 minutes and when exam is start time is reduces and when click for next question at then time is not refresh i mean time is not start at again and again...i mean time works as continues when page is refresh....
so please let me know some code or javascript or other ideas....
or mail me on kaushikb2005@yahoo.co.in
thansk.
kaushik
kaushikb2005@yahoo.co.in
|
|
|
|
|
Use this tag . It will refresh page every after 5 second.
Thanks
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
I have to impliment "3 tier architecture". can any one plz provide me link to a good source to study know abouts of above topic.
Thanx
|
|
|
|
|
|
Hi all,
I would like to open new window on button click from sever side and write HTML content to it. I have written following code but this writes the HTML content to the main window instead of the new opened window.
protected void btnClick_Click(object sender, EventArgs e)
{
Response.Write("<SCRIPT LANGUAGE=\"JavaScript\">\n");
Response.Write("window.open( '','popup','toolbar=no,menubar=no,scrollbars=1,width=750,height=800')");
Response.Write("</script>");
Response.Write("<html><head>");
Response.Write("</head><body>");
Response.Write("<div id='lnk' class='noprint' style='text-align:right'>");
Response.Write("<a href='#' onclick='window.print();return false;'>Print</a> ");
Response.Write("<a href='#' onclick='window.close();return false;'>Close</a>");
Response.Write("</div>");
Response.Write("<div id='printv' class='print'>");
Response.Write("This is test");
Response.Write("</div>");
}
can anyone please suggest me how can I achieve this?
Thanks a lot.
|
|
|
|
|
Check this out:
function Clickheretoprint(){<br />
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; <br />
disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=0"; <br />
var content_vlue = document.getElementById("print_content").innerHTML; <br />
<br />
var docprint=window.open("","",disp_setting); <br />
docprint.document.open(); <br />
docprint.document.write('<html><head><title></title>'); <br />
docprint.document.write('</head><body onload="self.print()"><center>'); <br />
docprint.document.write('<div align="left">'); <br />
docprint.document.write(content_vlue); <br />
docprint.document.write('</div>'); <br />
docprint.document.write('</center></body></html>'); <br />
docprint.document.close(); <br />
docprint.focus(); <br />
}
Source Courtesy:
http://forum.java.sun.com/thread.jspa?threadID=5279919&messageID=10175156[^]
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
|
|
|
|
|
Can anyone tell me how to convert .wmv, .avi,.mpeg etc.. to .flv using ASP .net with c#?
|
|
|
|
|
You need an appropriate component from the vendor. Try http://www.media-convert.com/[^] for a hosted services conversion.
I believe, http://www.zamzar.com/[^] also offers this service.
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
|
|
|
|
|
How many times, dont start a subject with question
We are not a Code Charity
|
|
|
|
|
Hello all,
In my application i am using javascript prompt box and taking input from user.
If user entered value and click on ok then i am performing some db operation.
I need prompt box should be a required field user must entered a value in that if he did not entered the value and click on ok then am displaying alert box and which tell user that this is required field. The actual problem is that if user click on cancel button it postback the page and displays alert box. I need if user click on cancel i dont want to show alert box. How can i do this. My code is as follow.
<br />
function disp_prompt()<br />
{<br />
var name=prompt("Please enter assessment name","Assmssent01");<br />
if (name!=null && name!="")<br />
{<br />
document.Form1['sname'].value = name;<br />
}<br />
<br />
}<br />
<br />
and on page behind<br />
<br />
on page load<br />
<br />
lnkSave.Attributes.Add("Onclick", "javascript:disp_prompt();")<br />
<br />
and on link button cilck<br />
<br />
Dim name As String = "test"<br />
name = Request.Form("sname")<br />
If name = "" Then<br />
Dim strMessage As String = "Assessment name is required."<br />
Dim strScript As String = "<script language="JavaScript">"<br />
strScript += "alert(""" & strMessage & """);"<br />
strScript += "</script>"<br />
Response.Write(strScript)<br />
Exit Sub<br />
Else<br />
db operation here.<br />
End If<br />
<br />
please tell me how can i solve the problem.<br />
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Did you miss a return ?
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
|
|
|
|
|
yes,
and prompt box return value in the textbox which user entered.
Eventhough i click on cancel it postback the page and execute my server side code.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
You need to return the result from the disp_prompt function:
function disp_prompt() {
var name=prompt("Please enter assessment name","Assmssent01");
if (name!=null && name!="") {
document.Form1['sname'].value = name;
return true;
}
return false;
}
In the onclick event you need to return the value from the function call to the event. Use lower case names for (X)HTML keywords. Don't use the javascript: protocol in event code, that's for when you put code in an url.
lnkSave.Attributes.Add("onclick", "return disp_prompt();")
Use the type property in the script tag instead of the deprecated language property. You need to use double quotation marks when you put a quotation mark in a string.
Dim strScript As String = "<script type=""text/javascript"">"
Don't use Response.Write to put code in the page. That will place it outside the actual html document, and throws the browser into quirks mode. Use the RegisterStartupScript method to add code to the page.
Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", strScript)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Sir
Thanks a lot .It works for me.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hi
we have a web Application which is install on the client
hosting server and it provide a control panel to our client that he can control his client's as Host.
Now i want to update our web application on all clients when new updates come just like the windows or any other software that updates it self how i Can do this
we have lot of clients.
please please help me.....................
Thanx for advance
wasim khan
|
|
|
|
|
|
K thanx Deepak
But my problem is that we create a web application (Like Control Panel)
so that our Hosting Server clients can manage their clients.
Can u please tell me that how i can Update the web application on the hosting server of our client.
One think more when some body purchase our web application we give him the installer to install it in his server
wasim khan
|
|
|
|
|
Something like Plesk/CPanel?
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
|
|
|
|
|
|