|
Hi,
Any one knows how can I use combo box or dropdown list in a datagrid at the time of inserting or editing the data.
Tahnking You!
Rock Star
|
|
|
|
|
You need to have a template column in datagrid and inside template column in edittemplate place the dropdown list control. It will be visible in edit mode only.
Apurva Kaushal
|
|
|
|
|
I have no problem uploading the file. and below is the code.
protected void uploadFile()<br />
{<br />
String projectID = (String)Session["projId"];<br />
if (!FileUpload.FileName.Equals(""))<br />
{<br />
String fileName = FileUpload.FileName.Replace(FileUpload.FileName, "myDesiredFileName");<br />
String extension = FileUpload.FileName.Substring(FileUpload.FileName.LastIndexOf("."));<br />
System.IO.Directory.CreateDirectory(Server.MapPath("Docs/") + projectID);<br />
<br />
FileUpload.PostedFile.SaveAs(Server.MapPath("Docs/" + projectID + "/" + fileName + extension));<br />
<br />
}<br />
}
Now I need to provide a link to download the file.(the file extension is unknown, it could be .doc,.xls.pdf)
Below is my code. But it's not redirected.
protected void btnLink_OnClientClick(object sender, EventArgs e)<br />
{<br />
String pid = Convert.ToString(Session["pid"]);<br />
String[] file = System.IO.Directory.GetFiles((Server.MapPath("Docs/")+ pid +"/"), "myDesiredFileName.*");<br />
Response.Redirect(file[0]);<br />
}
May I know how to make this work?
serene
|
|
|
|
|
serene joey wrote: Response.Redirect(file[0]);
Hi,
check this code. What you are getting in file[0]. Is it a fullpath of that file ?
Thanks,
Sun Rays
Rate this post if you like answer.
My Articles
|
|
|
|
|
Hi. Thanks for reply.
I printed the path. and Yes. It's the fullpath to that file.
Just that I don't know why, for some reasons, the last "/", which is before the file name and extension is "\" instead of "/".
which is like
C:\Documents and Settings\computerName\My Documents\projectName\Docs/fileName.extension
Does that matter?
serene
|
|
|
|
|
Hi all,
When i am exporting the information from grid to excel file in a web page using mouse click it is working properly. But when i tried to right click and click on save target as button, it is showing error in exporting file.
Could any one help me out in exporting the contents from grid to excel file using right click-> save target as option.
Thanks in advance
Rama.P
|
|
|
|
|
can any body say how to insert and display data in a form view????
|
|
|
|
|
in ur sqldatasource control click on advanced then check generate insert update delete statements...
hope this helps
BiG RaLpH
|
|
|
|
|
i hav done this.but the check boxes are non active.i cant click on it.
|
|
|
|
|
did you choose all the columns in that specific table?
If you didn't this will not work my point of view is to check all the columns specify the ones u don't want to see as visible = false
BiG RaLpH
|
|
|
|
|
can anybody guide me working with datagrid/table using keyboard arrow keys.
In web, when i tried to work with grid using arrow keys, there is no effect on cursor where as i want to transfer the control to the next cell.
Thanks in advance
rdv
|
|
|
|
|
rdvsharma wrote: i want to transfer the control to the next cell.
By Default, TAB key works to transfer the control to the next cell. why not use them?
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Thanks for your reply,
We can use the default tab key, but the client is interested to use the arrow keys/enter key for the mark entry, as the database to enter the marks is very big and using tab is not convenient to go to the specified cell.
i.e for eg: if the user enters the marks in the first cell in first row and after moving to 1st cell in 10th row, if he want to go back to first cell/second cell in first row he has to use the mouse/use shift+tab keys, instead he want to use up arrow/down arrow to move the position in the same location in the above/below row and so on.
kindly guide me in controlling of key navigations in a grid if u know.
Thanks and regards
|
|
|
|
|
hi friends,
i created two sessions with asp.net in the login page
1.username 2. userid .
i created a javascript menu & therez signout item. i want to clear the session when i click that & redirect to login page.. how can do it...
cheers..
|
|
|
|
|
your subject line says 'remove sessions with Javascript'. For your kind information - Javascript runs on the Client and Session is a server Object .
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
yes,, i know that,, but how can i clear the sessions while sign out.. my sign out menu is on script..based
|
|
|
|
|
You need to do the following in the server-end. call Session.Abandon() Method to cancel the session followed by Session.Clear() method to clear all the values from Session State.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
use Javascript to AJAX off to the server, then Session.Abandon()....
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
hi,
s, definetly we can use Ajax, but in some cases this will not work, that y i seek another method...
Thanks for ur great response..
|
|
|
|
|
How can retrive a data from databse without using DataTable or Dataset or DataReader ,but using System.object or store data into arraylist
-- modified at 1:45 Thursday 22nd November, 2007
|
|
|
|
|
Hi,
for what purpose you want to do this ?
If u want to bind with Gridview then you can add datasource.
Thanks,
Sun Rays
Rate this post if you like answer.
My Articles
|
|
|
|
|
but using Systen.Object Array, just to store data in array from database.
Once it get then that array can be assign to datasource
|
|
|
|
|
Dharti Gajjar wrote: How can retrive a data from databse without using DataTable or Dataset or DataReader
This is like saying "I need to write a computer program, but I don't want to use any programming languages". Why do you need this ?
|
|
|
|
|
dear frnd,
You can assign values from database to list(arraylist,generic list) but you should use atleast datareader to fetch data from database.
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
Vipin.d wrote: but you should use atleast datareader to fetch data from database.
You have not read the question, and you have not understood what I meant in my reply.
|
|
|
|