|
Hello,
Anybody can explain me how to create onclick event for label and textbox in Asp.net ?
because i have some task to be achieved on click event of textbox and label control?
Please help or provide any alternate solution?
Regards
|
|
|
|
|
Have a look into the Javascript events available. You can have a click event there and handle it in javascript. "No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
you can attach onclick event on label and textbox at server side as below
Label1.Attributes.Add("onclick", "javascript:alert('you have pressed Label')");
TextBox1.Attributes.Add("onclick", "javascript:alert('you have pressed Textbox')"); Cheers!!
Brij
|
|
|
|
|
hi,
i added button into gridview at designtime in first column.
after running the application if gridview get populated with data.
suppose it contain 4 rows.
if user click on button of 2nd row,i want show the message that you clicked 2nd row.
i.e. according to clicking of button i want to show the message of which row was clicked.
but how can i identify which button was clicked....
please, help me....
|
|
|
|
|
In the OnRowCreated event, assign the javascript click event and send the row index to it. That index you can then access in the server side click event through a hidden field. "No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
Use a button column and you don't need to do any of this. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
do you want to show the alert from javascript? Cheers!!
Brij
|
|
|
|
|
Use a button column or template column and specify the onclick even handler for client-side processing or handle the event on the server-side I know the language. I've read a book. - _Madmatt
|
|
|
|
|
ya i used template column for the button and assign the event handler.
and when i clicked on button it goes to that event.
but i want to know the row index of that row where the button is located(which get clicked)
can you provid me code .....
actualy, i am showing the booking status in that gridview,first the status is 'in process'
after clicking on button which is in gridview, it should the modal popup,in modal popup
after clicking on 'ok' button, the status of booking should replaced with 'cancel req.'
and for this purpose i want to know the row index of that gridview...
so please, help me...modified on Thursday, February 11, 2010 12:34 AM
|
|
|
|
|
thanks to all of you by helping me
i the problem get solved by me...
i get the rowindex of the button by rowIndex of button's parent's parent
this is written at the event which is assigned to the button at design time in template column...
i.e.
Protected Sub btnCancelClick(ByVal sender As Object, ByVal e As System.EventArgs)
Dim intRowIndex as Integer=sender.Parent.Parent.RowIndex
End Sub
BUT THANKSSSS To all of You....!
|
|
|
|
|
Hi,
I have developed small web application using ASP.Net and MySQL. I need to access this application using IP address from my friend system(In Office). Is it possible? I am having Windows XP.
Note:
From Windows 2003 Server I am hosting that web application and changed localhost to IP Address and its possible to access from others system. (ie) Server IP address (http://192.145.1.20/VDR/Login.aspx)
How to acheive by Windows XP with IIS?
Thanks,
Subbu
|
|
|
|
|
no this is not possible in windows xp.
|
|
|
|
|
How to stop the submit behavior of a Button(Server Ctrl)
|
|
|
|
|
Attach onClientClick event in at client side and call a javascript method which return false. Cheers!!
Brij
|
|
|
|
|
Hi..
We need to create a grid view control with multi column sorting with Up and Down Icons in header, can you give me a reference article for it.
Thanks,
Abbas
|
|
|
|
|
For sorting just have a look
msdn
For images,you can put the images in header,put both image up and down and show them according to the current behavior.At server side you can maintain the sorting type in some viewstate property.Cheers!!
Brij
|
|
|
|
|
|
Cheers!!
Brij
|
|
|
|
|
Could you solve? I had exactly the same problem, only i wanted to have the icons in the rows
|
|
|
|
|
Hi everybody
I have implemented a website to post messages and replies to those messages
now I want to allow users to enter programming source codes.
how I can do this.. I mean is it possible to implement a control like here in code project...
Please help me...
Thankyou...
|
|
|
|
|
There is no such control here. You just paste or write the text and apply a style to it. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi what im askin myself is how i can sort my gridview depending on the rank column in the database?
Its Loos like this
http://img2.immage.de/09028ecclientpic.jpg
I want to move rows up and down in a GridViewmodified on Tuesday, February 9, 2010 9:40 AM
|
|
|
|
|
I solved it(;-
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Up")
{
int i = int.Parse((string)e.CommandArgument);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i - 1].Values[0].ToString()), i + 1);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i].Values[0].ToString()), i);
BindData();
}
else if (e.CommandName == "Down")
{
int i = int.Parse((string)e.CommandArgument);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i + 1].Values[0].ToString()), i);
GroupAdapter.Update(Convert.ToInt32(GridView1.DataKeys[i].Values[0].ToString()), i + 1);
BindData();
}
}
|
|
|
|
|
Hi,
I want to do screen scraping i.e to get the data from a particular site after post back.
e.g
1)www.funjet.com
2)enter the origin and destination in the saerch criteria on the left
3) Get teh Avaibility page , and not to scrap the required data.
Need to perform the above operation through the code.
|
|
|
|
|