FindControl of web page having multiple imagebutton - asp.net

i am using asp.net to create the seat-map of cinema view. i have multiple imagebuttons on my page. When user made no selection, all the seats are appear grey but when user wants to select a seat and will click, it will become golden. After selection of seats when user finally booked seats, it will become red.
My issue is this that i cant find my specific control of web page and it will always returns me with exception.
enter image description here

Related

How to set the checked status of an asp.net user control'checkbox from one to another

I am having a asp.net web page on which I am loading a single usercontrol (UC) ten times. The first user control will be used to gather data about the ​main employee and the rest about his dependent. There will be "next" and "Previous" navigation button to move from one UC to another. I have couple of DevExpress check boxes on the UC. If the user checks any of them on the first page and then clicks the "next" button to navigate to the next UC, I want the checkboxes in the dependent UC also checked. I tried to do that in the page load event of the dependent controls in code behind. The code is given below. But it doesn't work. Looks like that I have to use javascript to do it. Please let me know how to do it.
codebehind:
dependentCheckbox.checked = mainEmployeeCheckbox.checked;
Thanks​

Remove focus on showing devexpress popup

I use Devexpress UserControls in my ASP.Net Project for displaying, editing, and deleting rows of data.
On one of my pages, I have two controls, a DevExpress grid and an ASP.Net button. When I want to edit a row, I click on the edit button of that row, whereupon a popup showing detail of that row is displayed. I can edit these details and then take some action. Tthis popup has buttons Cancel and Save, and when I press Enter key I want the Save action to be invoked. However, currently, when I press the Enter key, it is getting directed to the main page and not the dialog?
Does anyone know how I can get the Enter key to activate the Save action on the dialog instead?
Review the following examples to learn more on how to handle document events and respond to a particular end-user action:
E352
E3845

ASP.NET AJAX delay

I'm using VS2010,C# to develop my ASP.NET web app. I have some a combo box for selecting province and another combo box for selecting cities, when user selected a province, the city combo box should immediately display cities belonging to that province.
I have inserted an AJAX script manager into my page, also an AJAX update panel (both from toolbox) in which I've inserted my combo boxes. Then I enabled province combo box autopostback property so that when user changes his selection, I can detect it and change contents of city combo box accordingly.
It works fine, as I load province and city names from my database into a list at page startup (of course this load process is performed in a if(!IsPostback) statement so that data is loaded only once). I think the time needed to update city combo box is a bit more than what is required, as there is a postback when user changes province combo box selection, what is the best (and correct) way of performing this operation? is it ok? are there any better ways of doing it? how can I IMMEDIATELY update city combo box after province combo box selection is changed, as currently there is a short delay.
thanks
You're always going to have a delay if you do it on the server side with an ASP.NET postback.
Another option would be to output some JSON to your page on initial load which contains an array of all your provinces with a nested array for each province containing its respective cities.
Then you can remove the auto postback and do everything client side with JavaScript. Whenever the selected province changes you just need to parse your JSON and add all the associated cities to the second dropdown list.

Previous page should remain in same state when back button of browser is click

I have a page on which there are two drop down lists, based on the selection of those dropdown lists grid view is filled. In grid view there are imagebuttons. When user clicks on any of the image button, he/she is redirected to another page. Now when I click on the back button of the browser, I want page in the same state as it was before redirect. How can I achieve this goal??
use ASP.NET Multiview control instead of separate two pages this will create one page with two views which will effectively retain page state.
Please refer to these articles
http://www.beansoftware.com/ASP.NET-Tutorials/MultiView-Control.aspx
code project multiview

C# ASP.NET Post Back Data

I have a web page form which contains around 20 forms(home.aspx), on 1 of it i need to put a link beside a textbox which will be pop out when the user clicks the link(search.aspx). In this pop out link there will be a search textbox which will search the database based on the keyword that user enters. Let's say the user enters id number (1111) and the result shown will be the name of the ID 1111. The question is when the user clicks on the row of the result it will be automatically back into home.aspx and the selected name is placed in the textbox?
You can do a cross page postback from your search.aspx to your home.aspx. I'd consider putting the search in the page though. Why not just have the search box appear in your main form when you click on the link (make it a link button rather than a link).

Resources