Forms Data Controls :: Put A Click Button To Pass The Id Of The Photo To The Other Page?
Jul 31, 2010
I'm making a phot album for my family websit I'v gotten almost every thing down except the display. I have gotten the pictures to display as thumbnails using a datalist (because I can get the layout how I want it) However I wanted to put a click button to pass the id of the photo to the other page.So this is my question is their any way to pass the id from in a datalist to another page.this is the code i'm tryin to use now
I have passed the value from one page to next page using a querystring. In the next page i need to get the value from the query string and based on the value, it needs to checked with the database and the result set should be placed in the gridview, details view or listview anything else.
user mobileno email vicky 9848752322 ervigsh@gmail.com
In the details view or list view control, I need to get the value vicky from the url and based on the value's row in the database table need to be binded in any of the mentioned above controls.
I have a datalist and the following link button within the datalist:
[Code]....
I would like to post to a new page and then capture the value from the link button (commandArgument). It appears from other threads I've seen that you have to rebind the datalist in order for the ItemCommand event to fire...is this true? I'd hate to make another DB call to bind my datalist just to make an event fire.
When image button(+) is pressed the selected row of gridview1 is shifted to 2nd gridview.And in the 2nd gridview there is also a imagebutton(delete),when the delete button is pressed that row will move to 1st gridview.
I have a small problem I am returning some data from a query and have allowed paging, however when I click on the next button to view the following page the gridview disappears.
My datasource is specified in the code behind:
<asp:Panel ID="dtpanel" runat="server" Visible="False"> <asp:GridView ID="grddetails" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="grddetails_SelectedIndexChanged" ViewStateMode="Enabled" onselectedindexchanged="grddetails_SelectedIndexChanged" AllowSorting="True" > <Columns> <asp:BoundField DataField="Col1" HeaderText="Col1" SortExpression="Col1" /> <asp:BoundField DataField="Col2" HeaderText="Col2" SortExpression="Col2" /> <asp:BoundField DataField="Col3" HeaderText="Col3" SortExpression="Col3" /> <asp:BoundField DataField="Col4" HeaderText="Col4" SortExpression="Col4" /> <asp:BoundField DataField="Col5" HeaderText="Col5" SortExpression="Col5" /> <asp:BoundField DataField="Col6" HeaderText="Col6" SortExpression="Col6" /> </Columns> </asp:GridView> </asp:Panel> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data; using System.Data.SqlClient; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void GridView2_SelectedIndexChanged(object sender, GridViewCommandEventArgs e) { int y = Convert.ToInt32(e.CommandArgument); Control control = GridView2.Rows[y].Cells[0].Controls[0]; LinkButton btn = control as LinkButton; string qval = btn.Text; string query = "SELECT * FROM Table WHERE Col LIKE '%" + qval + "%'"; string connectionString = @"Data Source=servername;Initial Catalog=dbname;Integrated Security=True"; SqlConnection accessConnection = new SqlConnection(connectionString); SqlCommand accessCommand = new SqlCommand(query, accessConnection); SqlDataAdapter grddetailsDataAdapter = new SqlDataAdapter(accessCommand); DataTable grddetailsDataTable = new DataTable("Table"); grddetailsDataAdapter.Fill(grddetailsDataTable); int dataTableRowCount = grddetailsDataTable.Rows.Count; if (dataTableRowCount > 0) { grddetails.DataSource = grddetailsDataTable; grddetails.DataBind(); } dtpanel.Visible = true; } protected void GridView1_SelectedIndexChanged(object sender, GridViewCommandEventArgs e) { int w = Convert.ToInt32(e.CommandArgument); Control control = GridView1.Rows[w].Cells[0].Controls[0]; LinkButton btn = control as LinkButton; string qval2 = btn.Text; Label1.Text = btn.Text; string query = "SELECT * FROM Table WHERE Col LIKE '%" + qval2 + "%'"; string connectionString = @"Data Source=servername;Initial Catalog=dbname;Integrated Security=True"; SqlConnection accessConnection = new SqlConnection(connectionString); SqlCommand accessCommand = new SqlCommand(query, accessConnection); SqlDataAdapter grddetailsDataAdapter = new SqlDataAdapter(accessCommand); DataTable grddetailsDataTable = new DataTable("Table"); grddetailsDataAdapter.Fill(grddetailsDataTable); grddetails.DataSource = grddetailsDataTable; grddetails.DataBind(); dtpanel.Visible = true; } protected void grddetails_SelectedIndexChanged(object sender, GridViewPageEventArgs e) { DataTable dataTable = grddetails.DataSource as DataTable; grddetails.PageIndex = e.NewPageIndex; grddetails.DataBind(); dtpanel.Visible = true; } }
I have a gridview with 10 columns ,if i click anyone row in that grid ,it pass that corresponding row values to another page in next page i get that values and view in textboxes ,important thing is in that gridview i want to pass without using checkbox, hyperlink,button or anything.
I have a page that have 5 to 10 photos of a person, If some user comes into this page he should see facebook "Like" button next to each photo on that page.
I have installed Javascript SDk on my site, I can use XFBML also. Just post me some sample code if you have any?
How to redirect a page to a particular website link( links are saved in database) using database on button click, for particular DropDown value i.e, External. If dropdown value is "external", then on clicking button page should redirect to particular website link related to the above drop down. This link can differ in DB but DropDown value is same for all users i.e "External"..(these website links are saved in database, I have to fetch these links from database.
i am creating a website using asp.net, in that am using two text boxes for date that is from date and to date. when user click on button that should go to the url taking that text boxes dates for example
i have a web form in which i ve a button which will open a sliding pop up box(jquery) on click of it. In the same page i ve also a linkbutton for downloading files. Now the problem is first time wen i click that button it does nothing. (will not open popup box). Once i click on download button and then if i click that button it will open popup box along with download dialog box. Why is it happening so... is it because am using same event click for both these.
but download option is implemented in gridview_rowcommand()..
I have a problem with fileupload control. I have a fileupload control in my registration page. The user will have to enter their information and upload a photo at the same time. When they click RegisterButton, a modalpopup will show up to confirm that the information in the registration is correct and once they click ConfirmButton on the modalpopup, they are registered into the database. I want also to see the photo in the modalpopup.
I have a requirement of creating a form/template/page with controls like radio button, label, some database login for the controls on a button click.
For Example: Need to create a aspx form with 2 radio button, 3 textbox and a button control. For the above controls there shud be some database logic created automatically for storing values in the database.
All should happen in 1 button click.
Can we acheive this using .net. I am using framework 2.0 and VS 2005 and C#.
on my default.aspx page, i have one dropdownlist (which has book types as values e.g. small books, medium books etc.). Then one textbox. And one button named 'Search'. On button click the datagrid shows result by filtering table data with book type and search string that user enter in textbox.
So on 'Search' button click, i want to load the same page with result but with query string like 'Default.aspx?booktype=small' (using response.redirect) if user selects small in dropdown list. The problem is when i click 'Search' button and the page gets loaded again I cannot access dropdownlist values and search string that user has entered. It takes null only when I use,
I have a databound repeater and in this repeater is an imageButton. How do I pass info from the database into the click event? For example, I've got the description, heading and price fields populating labels, but want the id to go into the imagebuttons click event in order to build a querystring.
I have little strange question. I would like to Validate my Page Controls on the button click which is there in the User Control. This user control is placed on the Page. If I check Page.IsValid property on button click event, it returns false. But Validation Summary message doesn't popup. So user doesn't know what's happening. It will not save the information and it won't give the validation message too.
i have a hyperlink button which i assign few value (eg: custId, custDetail, custProd) then when user click on the link, it will pass all those value to another page. my question here is how can i get those value to display in the other page??
I am using VS 2005.An 1.aspx page is there, retrieving data from an xml file and having a button.On a button click same 1.aspx page should open new window retrieving data from another xml file with the help of query string.
in asp.net i want the user to chose a photo to upload from their HD . then i want the uploaded photo displayed and an hyperlink option to save or reject this photo. if accepted the filename will be stored in a DB.
the problem is displaying the photo before it has been saved.
I display strFileName which works on my PC but not on my laptop.