|
Hi guys,
In my string i have value like "picture.jpeg"...,
now this string i want to assign in to fileupload control after it want to save in to my server url...,
means using fileupload control i assign the file.., but not uploading the file in that page itself...,
just passing the filename in to another page there i am uploading the file...,
how to achive this...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
You can't change the text in the file upload control, and you cannot pass that text to another form, or get another form to read the file.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
set your file name in session and when u click on upload button in next page use
session value(i.e. filename).
Regards
Keyur Satyadev
|
|
|
|
|
You can't change the text in the file upload control, and you cannot pass that text to another form, or get another form to read the file.
But you can send the file as Stream. Here is an example. I used two page test-file-upload1.aspx ( from where user chhose the file to upload) and test-file-upload2.aspx( where the actual upload happens).
test-file-upload.aspx.cs:
-------------------------
protected void Button1_Click(object sender, EventArgs e)
{
Stream s = FileUpload1.FileContent;
Session["test"] = s;
Response.Redirect("test-file-upload2.aspx");
}
test-file-upload.aspx.cs:
-------------------------
string strPhysicalPath = "";
protected void Page_Load(object sender, EventArgs e)
{
strPhysicalPath = Server.MapPath("~/test-image/");
Stream fsInput = (Stream)(Session["test"]);
byte[] bufferInput = new byte[fsInput.Length];
fsInput.Read(bufferInput, 0, bufferInput.Length);
fsInput.Close();
//------------You can change the extension as original by sending the original extension in session
FileStream fsOutput = File.Create(strPhysicalPath + "test.jpg");
fsOutput.Write(bufferInput, 0, bufferInput.Length);
fsOutput.Close();
fsOutput.Dispose();
Response.Write("OK ");
}
I hope it solves your problem.
Please mark it as answer if helps.
|
|
|
|
|
HI all,
Can any one tell me the regular expression for Email address which accepts at least one alphabet.Please help me..
|
|
|
|
|
Hi All,
Can anybody tell me,how to read images from a html file and transfer it into sum other location.
Waiting for quick response.
Regards
Pulak
|
|
|
|
|
What does this have to do with ASP.NET ? Where are the images coming from ? Where do you want to move them to ? How is this a web development question ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
AS in my last question the tabing is working great for the first row.
the last object in the row is an event button, that causes the fields to be added to a total field on the row.
The problem is when it comes back from the Command Event it is starting the cursor at the top of the page and not at the next row in the datalist.
Is there a way to solve the cursor positioning problem?
If so, could you supply a suggestion..
Thanks...
|
|
|
|
|
for this u have to set focus property of the control in second row....
|
|
|
|
|
|
Write javascript that gets a reference to the row you want, and calls focus on it. This involves making sure your rows have id attributes that you can use to select them with document.getElementById
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This sounds like a really cool way to accomplish this except I don't have a clue about how to create unique id attributes or each row. I acutally have a sample of seting the cursor on an object in Javascript is that is not a problem. the problem now is "How to create these ID's for each row?"
Code sample please...
thanks...
|
|
|
|
|
I am actually not sure, if you're using a datagrid or gridview. I've done it in the past using a repeater, which gave me complete freedom over the HTML that was generated. You may be able to get the actual row tag in an itemdatabound event and modify it from there, that seems the most likely way to do it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am using vb.net with this datalist, as the code behind. I have found in the past that datalist, dataGrid and repeater are simular, if you could show me what you do with repeater maybe I can figure out what to do for the datalist... I do all sorts of modifications of attributes in the itemdatabound event, lsts add another.
Thanks...
|
|
|
|
|
The point is that with a repeater, you write out the HTML that is emitted verbatim, so you can build a table and set the td/tr tags to contain ids if you want. I don't think the datalist will let you, I think the itemdatabound event is your best bet
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The problem is I don't know what you mean by a row tag, is that like the index of the row. Because the ItemCommand event gives me the e.item.index of the row that I am on, me.datalist1.Items(e.item.index) at this point there is something called UniqueID is that what I want. How do I pass it to the javascript. There is also a .Focus() method here how does that work? Thanks for all your assistance...
Chuck...
|
|
|
|
|
If you look at the source code of your actual page, those controls are all building an HTML table. You want to focus on a row, so you need to be able to select that row. The tr or td tag in question.
If it has an id, the ClientID is the property you want. Then you can emit some js that passes the ClientID ( which you generate on the server ), to a method which takes that id, and selects the object and focuses on it
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I think you have helped me a great deal more than you may know.
I found an example of some microsoft stuff that might work. I'll get back to you later and let you know the results..
Thanks for all your help..
Chuck
|
|
|
|
|
I have a datalist that contains textboxes in the columns.
I have TabIndex set for every dataentry field on the page.
I have set TabIndex="121", on the first field TabIndex="122", on the second and so on.
The when tabbing the tabs go down the first column, then the second column and so forth.
So I changed all of the TabIndexes to TabIndex=121.
They still go down each column.
I need the tabs to go across all columns of the row before moving down to the next row.
How can I get the tabs to move across all columns in a row before moving down to the next row.
Can anyone give me "direction" and maybe a code snippet?
Thanks..
|
|
|
|
|
Making them all the same will not do it, you need to sequence them in the direction you want to go.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
As I stated in the explaination setting originally to tabindex="121", 122, 123 and so on in the datalist asp code did not work.
|
|
|
|
|
Hi...
I think it should take it automatically.....
If it is the case than you set one global variable and in ItemDataBound just get object of each and every control & u can set tab index=global_variable value for this controlobject. after setting tabindex just increase the global variable value to 1.
|
|
|
|
|
This is a great solution..
Worked perfect the first time...
Thanks..
|
|
|
|
|
Good evening.
In many places in my web application i use the asp:ImageButton control.
However ASP.NET interpreters it as for example:
<input type="image" src="Images/Edit.gif" onclick="javascript:__doPostBack('....','Edit$0')" style="border-width:0px;" />
And always Firefox asks me if i want to remember the password.
However in most cases the image button is not used for password submit.
Am i using ImageButton incorrectly?
How can i fix that problem ?
Regards, Hris
|
|
|
|
|
You can't change what ASP.NET renders, unless you write your own image button control.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|