really i think it is very complicated i hope it is not
my goal like this but this windows app
Image
i have abutton to browse an images folder i want user when choose image folder
my page load and appear agridview in editable mode and show images data i loaded from folder
user can change every row(every image) data
and click save button to save all images in database
i don not know how can i do this
can anybody help me plz
If I am understanding you correctly, I don't believe you need to have the GV in edit mode, you just need to include and upload control in each row. That way a user can select a file for each row and on button click you can loop through the GV and upload the file (if selected). As far as the GV setup, just bind as you normally would with an if (!Page.IsPostBack).
foreach (GridViewRow g in myGV.Rows)
{
FileUpload f = g.FindControl("myFileUpload") as FileUpload
if (f.HasFile)
{
// upload file
}
}
i used a fantastic jquery API called Uploadify
Related
I have a page for searching when I write my name for example in textbox it will search and display the results in a GridView. I'm using an EntityDataSource with a QueryExtender so I didn't write any code in C#.
The problem is: in the GridView I have a hyperlink when I click it, it will go to another page, ok fine then when I return to the previous page the GridView does not show the results of the search when I was left because of the postback (update panel) it show the whole data from EntityDataSource.
I think I have to use session but I don't know how I can do it, I mean how I can save the GridView in session and how I can retrieve it in page_load.
Scenario : I wanted to provide a GridView where the user can enter data row by row and display it(I did not bind to a database yet). I gave a footer where the user enters data and clicks add to add the data to the GridView. Finally, I gave a 'Save All' button to save the whole GridView data to the database.
What I did : I implemented it in this way where the data gets saved to an XML file when each row is added to the GridView. When the user clicks 'Save All' all the data in the file gets saved in the database. This implementation works perfectly.
My Question : My problem was that I found this implementation a bit complex and so i want to know if there are any other ways to do this(Javascript/jquery or any other). Any ideas/suggestions/links/sample codes are welcome.
Thanks a lot for your response guys. I used the Obout grid(Excel style) to achieve it. It works just as I wanted.
I have records that are displayed on a page and I have a small "edit" icon on the very right of each row.
So when I click the icon I want the user to edit "selected" row.
Now, I am generating the records and images behind code! so i am not using a control it generated a html code then i do something like this
output.InnerHTML = generatedCode;
Question, how can i create a function to determine which icon has been clicked and also that id of that icon?
If you are doing this with tables you must generate some unique id for each row edit link so that you can identify which row you have to edit. Apart from this there are pretty much easy way to display records in asp.net i.e GridView
Hallo there
I have and imageField as part of a gridview and would like to know how I can view this image in a different page when I select the row with a button(field).
When I add the information to a database the imageUrl is added to the database and this I tie up with the name of an uploaded image and subsequently the image is displayed in the gridview.
Is it possible for me to display this image on a different web page as well
thanks
Instead of storing image in session, why not populate Session["ImageID"] value on Button click?
Set gridview's OnRowCommand property to a method that will set Session["ImageID"] to the current row's DataKey, then do a redirect to that other page that will get value from Session["ImageID"] and get image URL for that ID from database. Don't forget to also perform Session.Remove("ImageID"). That way you'll keep your session object as small as possible.
Yes ,you can , i think if you store the selected image information in a Session.May be, there are other ways , but the first thing comes in my mind in this case using the session.
So, here's the scenario:
I have a page in my asp.net c# based website, which displays data dynamically after taking the request from query strings.
For example:
Brand=HTC&model=Wildfire
Now, in this page I want to display all the deals available in each network separately.
So, on the first pageload, I retrieve the data from the tables of each network that has the requested handset in a deal, store it as a datatable in the cache.
I have a datalist for displaying the imagebuttons of the networks that have the deals of that handset. The user will click on the imagebutton of a network to view the deals of that network.
To display the deals, I am using a gridview which retrieves its datasource from the cache. Also, I have provided filtering of the rows through dropdowns in each columns' header of the gridview.
All this is inside an updatepanel.
Everything's working fine.
The Problem:
I want that whenever the user clicks a network's image button, an image should appear above the gridview, containing the logo of that network.
Things that I have tried:
I am storing the networkname in the cache(which also required for filtering the gridview), whenever an imagebutton is clicked. Then, on pageload, I'm doing this:
if(ScriptManager1.IsInAsyncPostBack)
{
Image img = new Image();
img.ImageUrl = "images/" + Cache["network"] + "_logo.jpg";
nw_image.Controls.Clear();
nw_image.Controls.Add(img);
}
where, nw_image is a tablecell which i'm using to display the selected network logo.
and also I've saved the network logos in the images folder as: 'network'_logo.jpg
eg: 3_logo.jpg, orange_logo.jpg
The result of this is that when I click a new image button, the image that is displayed is that of the previous network, i.e. the cache is always one postback late.
Please Help!
Thanks!
Rather than using dynamic controls (i.e. creating the Image control manually on a postback), it would be much easier to just define an Image control in your page markup and default its Visible property to false. Then on your postback, set the ImageUrl property to the correct URL, and the Visible property to true.
Also, ensure that your nw_image table cell is inside your UpdatePanel, and you either have ChildrenAsTriggers set to true on the update panel (this is the default), or have specified an AsyncPostbackTrigger for the Click event of the ImageButton.
At last I've got it to work.
I've now put a static image without any properties except id = "net_img" , runat = "server" and EnableViewState = "true".
And instead of taking the network name from the cache, I'm changing the image in the click event of the ImageButton according to the Imagebutton that is clicked.
And it works now! :)