473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Button in Datalist

107 100+
My requirment is .......I have abutton in a datalist........on clicking the button it will rediect to another page.

My problem is how to access the button in a datalist
Aug 30 '07 #1
8 1335
mzmishra
390 Expert 256MB
You can use datalist.Item.FindControl("buttonname")
Aug 30 '07 #2
giveDsolution
107 100+
You can use datalist.Item.FindControl("buttonname")
That i knw but how to access the button click
Aug 30 '07 #3
mzmishra
390 Expert 256MB
Try through client side code
Aug 30 '07 #4
giveDsolution
107 100+
Try through client side code
Ya i knw it will done in client side but how?
Aug 30 '07 #5
mzmishra
390 Expert 256MB
onclick='OnTest()'

function ontest()
{

var ornaments = 'dialogHeight:600px;dialogWidth:920px;help:no;scro ll:no;resizable:no;status:yes;center:yes';
window.showModalDialog('page.aspx',window, ornaments);
}
Aug 30 '07 #6
giveDsolution
107 100+
onclick='OnTest()'

function ontest()
{

var ornaments = 'dialogHeight:600px;dialogWidth:920px;help:no;scro ll:no;resizable:no;status:yes;center:yes';
window.showModalDialog('page.aspx',window, ornaments);
}

Where to write the ontest(), I have to redirect like this 'page.aspx?id=Datakey of the datalist'

Howz this possible?
Aug 31 '07 #7
mzmishra
390 Expert 256MB
well........

I think You have the code like this for the button in datagrid
<ItemTemplate>

<asp:button onclick='OnTest(<%# DataBinder.Eval(Container.DataItem, "ID") %>)' >
</ItemTemplate>
where ID is the value you want to pass to next page

now put the function ontest() inside the <script> of your aspx file


if you want to redirect to another page the code will be like this



function OnTest(ID)

{
var ornaments = 'dialogHeight:400px;dialogWidth:650px;help:no;scro ll:no;resizable:no;status:no;center:yes';
window.location.href = "Page.aspx?id="+ID;//If you want to redirect
window.showModalDialog('Page.aspx?id='+ID,window, ornaments); //if you want to open a modal window
window.open('Page.aspx?id='+ID,winName,ornaments);//simple new window
}
Aug 31 '07 #8
giveDsolution
107 100+
well........

I think You have the code like this for the button in datagrid
<ItemTemplate>

<asp:button onclick='OnTest(<%# DataBinder.Eval(Container.DataItem, "ID") %>)' >
</ItemTemplate>
where ID is the value you want to pass to next page

now put the function ontest() inside the <script> of your aspx file


if you want to redirect to another page the code will be like this



function OnTest(ID)

{
var ornaments = 'dialogHeight:400px;dialogWidth:650px;help:no;scro ll:no;resizable:no;status:no;center:yes';
window.location.href = "Page.aspx?id="+ID;//If you want to redirect
window.showModalDialog('Page.aspx?id='+ID,window, ornaments); //if you want to open a modal window
window.open('Page.aspx?id='+ID,winName,ornaments);//simple new window
}

Sorry for late reply..........
but it is not working
<asp:button onclick='OnTest(<%# DataBinder.Eval(Container.DataItem, "ID") %>)' >
Sep 4 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris Fink | last post by:
Hello, I have a datalist that contains an asp button. I have the need to pass a value that is bound to my datalist along the button when the on_click event is fired. My datalist creates a button...
3
by: Chris | last post by:
Hi Folks, well I have this "small" problem with the footertemplate in a datalist. I added a button and a textbox to update the db with the given String of the Textbox. I already searched for...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
1
by: Glenn Owens | last post by:
Here's the scenario: I have a DataList populated from a datatable sitting inside a fieldset. Each element (row) in the Datalist has the following child controls: asp:checkbox, asp:image,...
4
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
6
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label...
3
by: Patrick Olurotimi Ige | last post by:
Can i have a Button in a Datalist? The button is for posting a form to the the Database FOr example:- <ASP:DataList id="heading0" RepeatLayout="Flow" RepeatDirection="Horizontal" ...
3
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
1
by: shantanu_kush | last post by:
Hi there, I am using a DataList in a composite control. The DataList has an Custom ItemTemplate(ITemplate) which adds a Button to the DataList Item as shown in the code below : public class...
1
by: Jim in Arizona | last post by:
I'm don't know how I would get around this. When working with a datalist control, there a specific built in commands (OnEditCommand, OnCancelCommand, etc). These commands, when the datalist...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.