|
there is no 'onclick' event for an "asp:dropdownlist"
and i need to show popup when user selects an item from the dropdownlist only..not on click of dropdownlist
|
|
|
|
|
The OnSelectedIndexChanged is server event and not suitable for your purposes. The client-side event you are looking for is onchange . So in the codebehind write:
ddlListSelect.Attributes.Add("onchange", "javascript:openPopupNew('frmPopup.aspx')");
|
|
|
|
|
Thanks
|
|
|
|
|
Hi
I am developing a application in asp.net.My database table contain some
candidate information.Suppose it contain candidate educational information
in datagrid i am showing a its graduation information and i am bound that
column and my table contain its post graduation information.If table contain
candidate PG information then i want to show its PG information below the
row of graduation.Means first row in datagrid conatin its graduation info
and if table contain its PG info then i want to show its PG info to tne next
row.how can i do this.i am able to add education info datagrid but i am trying
show its PG then its come in a single row.I want to show it below to first
row.How can i do this.
Rahul
|
|
|
|
|
if you just want to only show records(not 4 editing) to user then give me db query
|
|
|
|
|
Yes i want to show only 4 record in one row in table contain its pg information then this information should add below next row. my data database query is as below.Its not for editing.
str = "select BachlorDegree,B_Grade,B_PassingYear,B_Institute,LangKnown from EducationalInfo where UserId=" & cndid
this shows first 4 column.
Rahul
|
|
|
|
|
if u r trying to get only one candidate record of Grd and PGrd from 2 different tables and show it to grid then try this type of logic
dtGrd (this table contains Graduation info agiant CandidateID)
dtPGrd (this table contains PG info agiant CandidateID)
dt (this table contains that columns which u want to show from both ur above tables)
dim dr as DataRow<br />
<br />
if dtPGrd.rows.count>0 then<br />
<br />
dr=dt.NewRow<br />
dr.item("ColumnName")=dtPGrd.rows(0)("ColumnName")<br />
dr.item("......<br />
<br />
dt.rows.add(dr)<br />
<br />
end if<br />
<br />
<br />
if dtGrd.rows.count>0 then<br />
<br />
dr=dt.NewRow<br />
dr.item("ColumnName")=dtGrd.rows(0)("ColumnName")<br />
dr.item("......<br />
<br />
dt.rows.add(dr)<br />
<br />
end if<br />
<br />
Grid_View1.DataSource=dt<br />
Grid_View1.DataBinding()
if u want to do this for many candidate then use this logic in lop
Hope it's helpfull for you
Basharat
|
|
|
|
|
Thanks.
i am trying it.
df
|
|
|
|
|
hiii i need an applcation which would give an option to store the search result-columnnames in an xml file and use the xml file for future purpose for retriving the values using that xml file containing the column names....
I wud be very thankful if anyone help me out as i am newbie in .net
sharru4allin@gmail.com
|
|
|
|
|
I have the following function writen in asp.net with vb script. when click the update button everthing is getting updated except "date" I tried to update using date.parse also but no use. The same code was woking fine previous say a week back. I have not made any changes also. But I am not finding any reasons for this. this is happening whereever i have used date. Insertion or updation of date and searching based on date is not working.
Function update()
Dim flag As Boolean
flag = False
Dim tran As SqlClient.SqlTransaction
Dim a As String
a = txtexpdate.text
Dim d As Date = Date.parse(a)
If txtremark.Text.Trim = "" Or lblcustname.Text.Trim = "" Or txtcustdrno.Text.Trim = "" Or txtbore.Text.Trim = "" Or txtstroke.Text.Trim = "" Or txtapplication.Text.Trim = "" Or txtrod.Text.Trim = "" Or txtpress.Text.Trim = "" Or txteqpmodel.Text.Trim = "" Then
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Fields can not be left blank !"
Exit Function
ElseIf IsNumeric(txtbore.Text.Trim) = False Or IsNumeric(txtstroke.Text.Trim) = False Or IsNumeric(txtrod.Text.Trim) = False Or IsNumeric(txtpress.Text.Trim) = False Then
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Bore,stroke,rod and working pressure should have numeric value !"
Exit Function
Else
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
Dim comm As New SqlCommand()
comm = dbconn.CreateCommand
tran = dbconn.BeginTransaction
comm.Transaction = tran
Try
comm.CommandText = "update D_proposal set cust_drw_no='" & txtcustdrno.Text.Trim & "',cust_name='" & lblcustname.Text.Trim & "',typ_cyl='" & txttypcyl.Text.Trim & "',cushioning='" & txtcush.Text.Trim & "',bore='" & txtbore.Text.Trim & "',stroke='" & txtstroke.Text.Trim & "',application='" & txtapplication.Text.Trim & "',category='" & txtcat.Text.Trim & "',sada='" & txtsada.Text.Trim & "',rod='" & txtrod.Text.Trim & "',wrk_press='" & txtpress.Text.Trim & "',eqp_mdl='" & txteqpmodel.Text.Trim & "',mounting='" & txtmounting.Text.Trim & "'where pno='" & lblpno.Text.Trim & "'"
comm.ExecuteNonQuery()
'comm.CommandText = "update D_task_det set associate='" & txtassociate.Text.Trim & "',exp_date='" & txtexpdate.Text.Trim & "',remark='" & Replace(txtremark.Text.Trim, "'", "''") & "' where pno='" & lblpno.Text.Trim & "'and task='" & lbltask.Text.Trim & "'and leader='" & txtleader.Text.Trim & "'and revision='" & txtrevista.Text.Trim & "'and reassign='" & txtreassigsta.Text.Trim & "'and hold='" & txtholdsta.Text.Trim & "'"
comm.CommandText = "update D_task_det set associate='" & txtassociate.Text.Trim & "',exp_date='" & d & "',remark='" & Replace(txtremark.Text.Trim, "'", "''") & "' where pno='" & lblpno.Text.Trim & "'and task='" & lbltask.Text.Trim & "'and leader='" & txtleader.Text.Trim & "'and revision='" & txtrevista.Text.Trim & "'and reassign='" & txtreassigsta.Text.Trim & "'and hold='" & txtholdsta.Text.Trim & "'"
comm.ExecuteNonQuery()
tran.Commit()
flag = True
lblstatus.Visible = True
lblstatus.ForeColor = Color.Green
lblstatus.Text = "Successfully updated !"
Catch ex As Exception
tran.Rollback()
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Transaction failed !" '+ ex.ToString
Finally
comm.Dispose()
dbconn.Close()
End Try
Return flag
End If
End Function
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
update()
End Sub
Chaitra N
|
|
|
|
|
What is your date column datatype in Database ? Have you tried running the same query in query analyzer ? If so what error you got ?
|
|
|
|
|
Now it is working. I have changed the enableviewstate property of all the controls to true and readonly property of datetextbox(text boxes where we have date value) to false. But i want datextbox readonly. What can I do for this?
Chaitra N
|
|
|
|
|
hi
i m new developer of ASP.NET and i want to develop one small project that is web based gaming or say online gaming so please give me some idea about my project. how to developed . i have to do it within 3 months
purvi
|
|
|
|
|
If U create your website page with ".aspx", then U must use AJAX control in it. Coz game site must Have interactive interface.
If not U can make your website from macromedia Flash
Regard,
Edwin
|
|
|
|
|
Hi,
I have two problems here.
1. When I open a page, when some criterias met, I want all the textbox, drop down box etc to be disable. I know I can disable them one by one but there are just too many of them and I have 10 similiar page, so I was wondering whether is there anyway that I can use a few line of codes to disable all of them.
2. I am using server side window.open as below
public void Window_Open(string url, bool resize, int height, int width, int scrollbar)
{
System.Web.HttpContext.Current.Response.Write("");
System.Web.HttpContext.Current.Response.Write("window.open('" + url + "','','resize=" + resize + ",height=" + height + ",width=" + width + ",scrollbar=" + scrollbar + "');");
}
Which works well but when it will refresh my parent page and cause all my fonts to become larger. I need to hide the link button which call Window_Open(...), so I have to put it as server side control so it only appear when some criterias are met. So is there anyway I can stop the page from refreshing from the server side?
Thanks in advance.
J Liang
|
|
|
|
|
1: Place the controls you want disabling inside a panel and disable the panel.
Cheers,
|
|
|
|
|
Hi,
Disabling the panel might not be a good idea for me as it will grey-out the entire interface and make it harder for the user to read. Further more, there is something else I need to leave it active such as a button.
Any idea other than using panel?
Thanks in advance.
J Liang
|
|
|
|
|
Just don't place the button on the panel...
OR:
Name all your text boxes so they start with "textbox" "txtb" or "tb" etc etc (its a good idea to name controls like this anyway).
<br />
foreach (Control c in myPanel)<br />
{<br />
if(c.ID.StartsWith("textbox"))<br />
{<br />
((TextBox)c).ReadOnly = true;<br />
}<br />
}<br />
|
|
|
|
|
J Liang
1. At the end of your page having HTML ... use some javascipt following way ...
Exaple: getElementsByTagName("input") returns all input HTML control in your rendered page. Now iterate in a loop to set the "disabled" property as you want.
var arr = document.getElementByTagName("input")
for(int i=0;i<arr.length;i++)
{
if(arr[i].type='text')
{
arr[i].disabled = true
}
if(arr[i].type='button')
{
arr[i].disabled = true
}
//like this
}
2. Is there any explicit reason that you are opening a new window from the server side.Generally there is no reason to open a window from server side
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi,
1. I could not use javascript, unless from asp.net, it can use that piece of javascript you posted here as the javascript only allowed to run if some of the criterias are meet where the checking is done using asp.net.
2. The reason I set the link to open a new window as server side control is because I need to hide it and only make it available when some criterias are met. Again, the checking is done from asp.net.
Any idea which I can solely do all these things using asp.net?
Thanks in advance
J Liang
|
|
|
|
|
I've had a quick search of the forums but no posts seem to cover my question.
Unlike the other posts on dynamic controls: my controls render fine, they respond to events that I've wired them up to....
It's just I'm looking for a technique that is more dynamic and elegant for wiring the events up.
For example:
I have one page that dynamically changes it's contents depending on the url used to navigate to it (An HttpHandlerFactory helps do this for me) So the content generator on PageContent.aspx could be pointed at, say, 20 different XML sources and thus render 20 totally different pages...
the problem with my current method is that it requires all the events for those 2 pages to be defined and wired up in one place.... Which makes the page code behind very cluttered with all the possible events.
Is there any way to do this in a more elegant fashion?
say, for example:
* Store all the events for one possible page layout in another file??
* Access a class containing all the possible events via dynamic Javascript on the page that makes calls that are handled by an HttpHandler??
* Or any other way?
Cheers,
|
|
|
|
|
Hello,
I use user.identity.name to display the current user in my webpage. My page also has a send email notification button to the intended recipient together with the URL link where he/she can locate the page.The recepient will receive the email and open the URL to the webpage. Then it will direct the recipient to log in page to log his/her ID for authentication.My problem is, the label that display user.identity.name still diplay the last username. I need to show the current user of the page. Pls advise and show me the proper code for this. I am using asp.net vb code.
Thanks in advance.
|
|
|
|
|
will you please paste the code where you change the label text
|
|
|
|
|
goo morning every body
how to use scrolling in grid view
help me
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
place your grid in panel and set panels proper Panel1.ScrollBars=ScrollBars.Vertical
may be it's helpfull 4 you
Basharat
|
|
|
|