|
hi.. use this code in GVList_RowDataBound(...)
Dim btnDel As ImageButton, btnUpd As ImageButton, lbexp As Label
If e.Row.RowType = DataControlRowType.DataRow Then
btnDel = CType(e.Row.FindControl("btnDelete"),ImageButton)
btnDel.Attributes.Add("onclick", "return confirm_delete();")
btnDel.CommandArgument = e.Row.RowIndex.ToString
'btnUpd = CType(e.Row.FindControl("btnUpdate"), ImageButton)
'btnUpd.CommandArgument = e.Row.RowIndex.ToString
End If
|
|
|
|
|
Thanks for the reply..
You are in the retriving phase. I am asking how to add a server control to the header ?
|
|
|
|
|
You can place the Image button in the header template also same way as row databound event gets fired for the headers and footers also.
Apurva Kaushal
|
|
|
|
|
Hi Dana,
I assume you have already added the ImageButton to the GridView. And here is how you do the rest.
The GridView's RowCommand event will fire when you click on that ImageButton in the GridView. That is in your code imgSortAssendingbyId.
(This command basically fires for any button’s click event, in the GridView).
Example:-
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
Response.Write("You Clicked the Button");
}
Thx,
Gayani
|
|
|
|
|
hi all,
i have a httphandler that returns an image when i send it text (and other parameters). The trouble is i have a need to send the string 'news + events', but the '+' is not being output at all.
code in page
_HeadingTextImage.ImageUrl = "textimage.ashx?text=" + Server.UrlEncode("news+events");
code in httphandler
string qText = (query["text"] == null) ? UsageText : context.Server.UrlDecode(query["text"]);
qText always = "news events" when i step into it.
can anyone tell me how to do this please?
thanks,
Maurice
|
|
|
|
|
|
hello,
thanks for the reply. that page encodes news+events as news%2Bevents which is what i get as input to the handler in the raw url (Request.QueryString)
but when i do Request.QueryString["qText"]; it return "news events", replacing the %2B with a space.
thanks,
Maurice
|
|
|
|
|
thank you i have resolved the issue.
if i urldecode the query in the handler it doesnt work, but if i urlencode the url in the page then just process it in the handler without urldecode'ing it, then it works fine.
regards,
maurice.
|
|
|
|
|
Hi
I have four text box. In my application the 2nd text box is focused. while i click
the button the 2nd text box is focused. But i dont know while i click the button
In which text box is focused. How i find that while i click the button in which
text box is focussed. I hope for ur's reply friends.
Thanks
Every Successful Person Have A Painful Story
|
|
|
|
|
check this forum out:
http://forums.asp.net/t/1110575.aspx
|
|
|
|
|
currently i m using asp.net with c# (.net 2005, 2.0 framework) and sql server 2000.
i want to store a sql query into a field in database... how to do it?
execute the below statement, and how to store it?
INSERT INTO tbl_templates_rsamonitoring(Template_Name,query,insert_date) values('sample','select tbl_rsa.rsa_level4 as \"BU - Level 4\",tbl_rsa.rsa_level5 as \"BU - Level 5\",tbl_rsa.rsa_sbu as \"BU - Level 3\",tbl_rsa.rsa_category as \"BU - Level 1\",tbl_rsa.rsa_level8 as \"BU - Level 8\",REPLACE(CONVERT(VARCHAR,tbl_rsa.rsa_ctrlculture, 106), ' ', '-') as \"Control Culture\" from tbl_rsa where rsa_mode=1','5/15/2008 3:53:47 PM')
that is...
template_name = sample
query='select tbl_rsa.rsa_level4 as \"BU - Level 4\",tbl_rsa.rsa_level5 as \"BU - Level 5\",tbl_rsa.rsa_sbu as \"BU - Level 3\",tbl_rsa.rsa_category as \"BU - Level 1\",tbl_rsa.rsa_level8 as \"BU - Level 8\",REPLACE(CONVERT(VARCHAR,tbl_rsa.rsa_ctrlculture, 106), ' ', '-') as \"Control Culture\" from tbl_rsa where rsa_mode=1
insert_date='5/15/2008 3:53:47 PM
how to achieve it? - KARAN
|
|
|
|
|
It's a string, so store it in an nvarchar column. Did I miss something ?
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 )
|
|
|
|
|
INSERT INTO tbl_templates_rsamonitoring(Template_Name,query,insert_date) values('sample','select tbl_rsa.rsa_level4 as \"BU - Level 4\",tbl_rsa.rsa_level5 as \"BU - Level 5\",tbl_rsa.rsa_sbu as \"BU - Level 3\",tbl_rsa.rsa_category as \"BU - Level 1\",tbl_rsa.rsa_level8 as \"BU - Level 8\",REPLACE(CONVERT(VARCHAR,tbl_rsa.rsa_ctrlculture, 106), ' ', '-') as \"Control Culture\" from tbl_rsa where rsa_mode=1','5/15/2008 3:53:47 PM')
columns - datatypes
Template_name - nvarchar(100)
query - nvarchar(1000)
insert_date - datetime
table name : tbl_templates_rsamonitoring
when i try to execute the above insert command the error Line 1: Incorrect syntax near ', '. is generation... help me to resolve.
thanks for understanding - karan.
|
|
|
|
|
i m currently using asp.net with c# (.net 2005, 2.0 framework)
cmd = new SqlCommand("UPDATE tbl1 set name='" + textbox1.Text + "',lock_datetime='" where id='" + txtid.Text + "'",conn);
MyLib.cmd.ExecuteNonQuery();
after executing this query i need the value which is updated in the table (i.e, the name which is saved from textbox1 to database)
how to retrive it? - KARAN
|
|
|
|
|
um, isn't it testbox1.Text ?
Also, this code is a disaster - you need to read on SQL Injection Attacks, aka all the ways this code allows me to attack, exploit and destroy your database.
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 )
|
|
|
|
|
Try to use stored procedures rather then inline code.
Like Graus said it is the value in textbox1.text but you can also get it from the database using a simple sql select statement
|
|
|
|
|
thanks my friends..
after updating we can get the value by applying select query.
what i m exactly expecting is after the update statement has been executed successfully, the updated value should return and i like to store it in a string variable. is there any function or process like this?
help me !
thanks in advance....
|
|
|
|
|
Well, apart from the obvious ( it's ALREADY in a string variable ), if you want to do this to confirm it was stored, you can do this in a stored proc.
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 )
|
|
|
|
|
i dont know to write store procedure....... anyway... thanks....
|
|
|
|
|
Application_Start in global.asax is not firing.can anybody help
|
|
|
|
|
Where are you storing the session in state_server ?. Events in global.asax will be fired only if they are stored in InProc..Check your web.config to if it is InProc.
Thank you
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
I want to build a crawler that crawls over nyddc.com and fetch all the excel files on that site, but i want to know how my crawler login and goes to intended page, means if i have username and password how can i use both to login in nyddc and fetch excel files from a page.
|
|
|
|
|
Well, you can't do it in ASP.NET, you have to do it in C#, in a windows app.
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 )
|
|
|
|
|
To be completely correct, you CAN do it in ASP.NET, but I don't see any reason why would you
|
|
|
|
|
So how can i do that please help me.
|
|
|
|