I marked it as a good answer but I think people asking these questions should do a Search for the same. These things are already explained at so many places. So if you do a search and read some articles/posts you will have a complete understanding of the topic. Just my opinion.
The Server.MapPath() actually returns the physical location of a file based upon a relative path provided to it. So, while saving the image, use of Server.MapPath() is the correct way to obtain the physical path for saving the file.
But, while you have to display the file in the <asp:image> server control, you should assign a relative URL of the image to the Image1.ImageUrl property. Assuming that, you are storing the image under the "/hint" folder (Inside your web application root folder), you should write the following code for displaying the image:
How can I read data from ListView into my List list?
The operation of reading ListView data into List generic list should begin after clicking the button "GetData".
I saw the following advice:
List<MyClass> list = ListView1.Items
.Select(lvi=>lvi.DataItem as MyClass)
but it does not work - the DataItem property of each Item of ListView has null value.
The point is that I have generic list with data. I am binding this data into ListView which can be edited by user. After that after click Save or GetData data from ListView is read into generic list of MyClass type.
i have got 3 text boxes in my content page. on the press of enter key in textBox1 focus should be on textBox2 and there on press of enter key focus should be on textBox3. after pressing enter key there, button click event should be called.
please help me with some code
If you understand Static class concept properly, then you will automatically come to know which method best suits your requirement. If the class is not specific to a particular instance or otherwise if you want some logic shared among all the users then you can go for static classes.
Does anyone know where I can find examples and/or explanations on how to implement Structure Maps/Dependency Injection in C#? I have tried finding examples on the Internet, but what I found was not very good.
Are you assigning the value of the checkbox outside of an if(!IsPostBack) statement? If so your view state value is being wiped. If you are using DataBinding, make sure your DataBind call is wrapped inside of an if(!IsPostBack) as well.