Clicking on image in an asp. Net web forms page - asp.net

I have a asp. Net web forms application which displays an image to the user. The image is displayed as an image control. I want the user to click on two different spots on the picture. I want to retrieve the positions where these events take place, and draw a line between the points. How can I add mouse event handles to any control, and specifically an image control?
Can I do seething like this:
Image.Click += new System.EventHandler(this.myEventHandler);

Related

C# ASP.NET 6.0 getting button text from shared page to index page as variable

I have 4 buttons in my layout page (shared page) and I want to use these buttons' text value upon click event. The text value needs to be used inside the index page, in order to execute C# code.
I have been looking everywhere for a solution to that. I would appreciate any ideas.
I want to create a single page web application, that changes data in index page, based on the clicked button in layout.

FindControl of web page having multiple imagebutton

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

Give control back to the first page after Server.execute()

I have a registration.aspx page. After entering all the information, user has to press the register button, which will add it to the DB. After that it shows a message that says "registered successfully".
To do this I created a separate web form to display the success message. So after the process happens successfully I simply call this separate .aspx file by using
Server.Execute("~/AlertMsg/ValidationMsg.aspx");
So everything is fine. The user can see a beautiful box at the top of the page. But the problem is after executing the 2nd page (ValidationMsg.aspx) inside the 1st page, control goes to the 2nd page. Because of that, if I click a dropdown or button in my 1st page (that has autopostback enabled), my page only shows the validation window.
What I wanted to do is to take control back to the 1st page after executing the server.execute. What should I do? Is there any good way to do this? I don't want to use JavaScript.
Below green color box is my separate web form.
Image 1:
Image 2 (after registering):

CKEDITOR ASP.NET Custom Properties

I am using CKEDITOR in ASP.NET and I would like to create custom configurations on the buttons. This means that when the user presses the image button , and the image dialog pops on, automatically some fields like 'Stylesheet classes' are ready written. This means that the client does not have to input such details every time he/she inserts an image but such content will be already predefined in the editor.
How can be this done?

How to create a reusable grid view component like date time picker in asp.net?

I want to create a reusable user control which contains a date time picker in asp.net. Need to add this user control in a grid view as column.While clicking the column,date time picker has to be displayed.Which is the suitable method,Creating the component or creating the user control.Also want to know,How to add this component in to the toolbox?
The main difference between a component and a control is that a component has no UI... so clearly it is a control that you want as there must be a user interface portion for a date picker.
As for getting your control into the toolbox, right click it and there is an option to add item(s) which presents a browse dialog allowing you to locate the assembly containing your control.
You can drag and drop UserControls without them being in the tool box. When you're in design mode for an .aspx or .ascx page, you can drag and drop the UserControl from the Solution Explorer (by just selecting the file and dragging it).

Resources