|
editor.aspx is another page which shows the image of the clicked image button. my requirement is to show the image of the imagebutton am clicking but after clicking on the imagebutton i get the last imagebuttons image on editor.aspx.i want the image of the imagebutton which i have clicked . have used the session[selected"] to get the value of the selected imagebutton to the next page.but am getting the last ones sessionvalue
|
|
|
|
|
hi all,
i an having a data table it contains lakhs of records, when i am getting this data, my browser is becoming slow.
how can i get the data to a specific range(example :1000 at one time)paging concept will work for this....
help me..
Regards,
S.Inayat Basha.
|
|
|
|
|
Yes, paging will definitely work for this scenario. You can implement paging at grid itself or for better performance you can try implementing paging at database level.
Regards,
Prakash Kalakoti
|
|
|
|
|
In this scenario,Paging at DB side will be better.
|
|
|
|
|
Definitely the DB paging is always a better option, but its little complex in implementation.
Regards,
Prakash Kalakoti
|
|
|
|
|
I actually suggested it because in the given scenario ,its having lakhs of records which is not feasible to store at server memory and if its going to be user specific then its going to hazardous for the server and performance of application
In all it depends on the requirement and the size of data
|
|
|
|
|
Hi,
I have a database (access) that contains a table GALLERY.
Now i need while uploading a file to insert the path in this way to the db
"~/photo/XXX.JPG"
What i get right now is only the file's name.
This is what i used for saving the path
FileUpload1.SaveAs(Server.MapPath("~/photo/" + FileUpload1.FileName));
I've tried it with and without the Server.MapPath.
The resault without the server.mappath was "The SaveAs method is configured to require a rooted path..bla bla bla"
With the Server.MapPath it works but not the way i need it. as i said it inserts only the file's name to the DB.
Can anyone please help me with that.
Thank you,
Basil.
|
|
|
|
|
The FileUpload control has a SaveAs(string path) method. You can use that method to save the file to any path using any filename you want. Just make sure ASP.NET has permissions to write to that path. So, you can do something like this to save the uploaded file to the uploads folder in the root of your website:
fileUpload1.SaveAs(Server.MapPath("~/uploads/")
+ System.IO.Path.GetFilename(fileUpload1.FileName));
|
|
|
|
|
thank u for ur reply
i've tried that, still at my database i get only the file's name without the path ~/folder/...
i need to add it as a string before the file's name.
or! if there was a way for inserting like an auto text option to that column each time i insert the data (before the file name).
any idea how?
thanks
|
|
|
|
|
Do not post to multiple forum
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
im sorry actually i disabled the code lol
now im running this code ugave me and im getting some errors.
System.IO.Path' does not contain a definition for 'GetFilename'
The name 'fileUpload1' does not exist in the current context
|
|
|
|
|
Hi there,
the ID of your upload Control is "FileUpload1" in your example, not "fileUpload1". Always pay attention to the letter case. Same with GetFilename. The Method is written "GetFileName".
What the upload control does, is the following: it saves your
selected file to the file-system. No path-saving to your database at this point. Where
are you saving the path to your db? there you have to save the virtual path of your upload
folder in addition to your filename. Just concat the strings there.
Good Luck
|
|
|
|
|
Hi michaelschmitt,
thank you for ur reply and for ur information
the letters are actualy as they should be.
____
I still cannot get it fixed even after adding the System.IO.Path..
//
FileUpload1.PostedFile.SaveAs(Server.MapPath(("~/photo/" + System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName))));
//
|
|
|
|
|
What i was trying to say is that your posted code does not include any interaction with
your access database. It just takes the selected filename from your upload control and saves this
file to the desired folder. This code alone would not insert the filename into your access-database table.
To clarify:
"~/photo/" is the virtual path of your upload folder. Server.MapPath is needed to tranform this to the corresponding
physical directory on your web-server (e.g.: c:\http\mysite\photo). FileUpload1.SaveAs(...) saves your file to this folder.
Use
string virtualFilePath = "~/photo/" + FileUpload1.FileName;
to get your desired Path und save it to your database.
modified on Monday, March 29, 2010 9:43 AM
|
|
|
|
|
i want to fetch time and date information separately from a datetime type field of a table created using sql 2005 of asp.net...i wasn't able to understand the pages displayed on google for the same query...??
|
|
|
|
|
Not sure if I understood your question correctly.
You can use the convert method and pass in the style. You can get the date by using styles 101 to 107 and 108 or 114 to get the time part.
This MSDN article[^] provides you with the syntax and shows the output for the various styles.
Tarakeshwar Reddy
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
i've used a gridview datasource control to display the schedule ....thr in i've specified the time field as datetime datatype in the table....nw when i'm displaying the page along with time, date is also being displayed...i don want to display the date....but only time....can you help me...???
|
|
|
|
|
You can use a bound field and set the DataFormatString.
<asp:BoundField HtmlEncode="False" DataField="Time" DataFormatString = "{0:T}" HeaderText="Time">
Take a look at the Standard DateTime Format Strings [^] and this article[^] which shows you how to create a bound field.
Tarakeshwar Reddy
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
|
See responses to below.
You should stop and do some research on your own. These are not difficult problems to solve and there are plenty of resources available.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Am doing aE-greetings project . so i need to send mail with some text and url of the greeting cards (which is selected by the user) . so pls help me and i have to send automatic email for reminders . please let me also know the technique behind this also. pls
|
|
|
|
|
What part of this are you having difficulties with? What research have you done? What have you tried?
We are not here to do the work for you. If you are having difficulties with a particular part, then ask, but you should first at least try something yourself.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
You question not clear.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
string path = MapPath("~/cards/");
string full = path + Session["file"] + "/";
string[] s = Directory.GetFiles(full);
foreach (string str in s)
{
string f = Path.GetFileName(str);
ImageButton im = new ImageButton();
im.Width = 150;
im.Height = 150;
im.ImageUrl = "~/cards/" + Session["file"] + "/" + f;
Session["selected"] = im.ImageUrl;
im.Click += new ImageClickEventHandler(im_Click);
PlaceHolder1.Controls.Add(im);
EnsureChildControls();
}
}
protected void im_Click(object sender,ImageClickEventArgs f)
{
Response.Redirect("editor.aspx");
}
|
|
|
|