|
|
Hi,
I have the same lines of code on my home PC, but at work it doesn't seem to want to work. What I want to do is to break down a file into it's file name and extension.
Here is my code in my button click event handler:
if (fuWineImage.HasFile)
{
string filepath = fuWineImage.PostedFile.FileName;
string pat = @"\\(?:.+)\\(.+)\.(.+)";
Regex r = new Regex(pat);
Match m = r.Match(filepath);
string file_ext = m.Groups[2].Captures[0].ToString();
Response.Write("filepath = " + filepath + "<br />");
}
The error that the browser gives me is:
Specified argument was out of the range of valid values.
Parameter name: i
The result of the Response.Write is:
myFile.jpg
Why is this not working??
Please can someone help me
Regards,
ma se
|
|
|
|
|
Well for one, there doesn't seem to be an i variable in your code that you posted, so hard to tell...
But why don't you just import the System.IO namespace and use the following:
Path.GetFileNameWithoutExtension(filePath);<br />
Path.GetFileName(filePath);<br />
Path.GetExtension(filePath);
|
|
|
|
|
Does anyone know if running ASP.NET 1.1 and 2.0 on the same server is a problem. I know I can set the Version in IIS properties but does this cause any issues?
thanks
|
|
|
|
|
Not that I've run into - have had 1.1 & 2.0 running for months with no (apparent) problems
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
|
Not a problem on my development and deployment machines.
Just need to remember to set the correct ASP.NET version.
Dan Satria
Principal Consultant
Graha Logica, Inc.
|
|
|
|
|
Hi all,
I just want to know the use of global.asax file. How its beneficial for web projects.
Varun Arora,
Software Engineer,
Knowledge Calls,
Gurgaon, India
|
|
|
|
|
It is the place to declare/initialize application-wide variables.
The global.asax file allows developers to add application and session level logic to their web applications. It is a special file which contains events which are fired when the application starts and stops, and when a users session starts and stops.
It is optional, but if you have one it must be located at the root of your site or your virtual directory. ASP.NET parses and compiles it into a class which extends the HttpApplication base class the first time any page within the application is requested. Global.asax cannot be downloaded through Http.
Read this this[^]
or
this[^]
for more information
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Hi,
Thankyou so much for providing me help.
Thanks and Regaurds,
Varun Arora,
Software Engineer,
Knowledge Calls,
Gurgaon, India
|
|
|
|
|
Always welcome.
Happy it helped
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
i am using listbox server control. When i made selectionmode multiple, it works fine. but when i make selectionmode single, i am unable to deselect any selected ite in list box. In this case if once i select any item then i have to select atleast one item from list and my requirement is to make user able to deselect that selected ite.
Need it urgent.
|
|
|
|
|
Hi,
You can not deselect item from list you have to select atleast one item.For your purpose you can add one empty('') value as item in list,which can be set if don't want anty item to select.
regards,
Nagraj
|
|
|
|
|
how many maximum number of catalogs i can add in indexing service?
and how many maximum number of direcories can be added in one catalog?
Is it possible to add directory progarmmatically?
M vinod
|
|
|
|
|
Hi all,
I had a requirement of installing only updated files (patch installation - pages & Dlls) into the running system (which is already installed web setup) in the server. is it possible through Web Setup Project?
Any suggestions or corresponding links are welcome.
Best Regards
Mahesh
[K.Maheswara Raju]
|
|
|
|
|
I have installed Windows XP Professional and then .net 2003. After creating a new web project, when I try to run it then it shows the following message on browser.
Access to the path "c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files\webapplication3\4c790788\4b8c4c7" is denied
I have checked the directory above but there was not any folder named webapplication3 in "c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files\". I have checked it on many sites but i dont find any solution of the problem.
Varun Arora,
Software Engineer,
Knowledge Calls,
Gurgaon, India
varun_soft11@yahoo.co.in
-- modified at 7:27 Tuesday 20th June, 2006
|
|
|
|
|
|
Sorry, It dint work. Same problem continues.
Varun Arora,
Software Engineer,
Knowledge Calls,
Gurgaon, India
|
|
|
|
|
I have a redirect to a page that has a short message upon it. After a certain length of time I then want to redirect them to another page. If anyone can point me in the right direction it's most appreciated.
Regards
Paul Mc Gann
|
|
|
|
|
|
You need Javascript SetTimeout in your second page.
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
I have a vb.net web application.
I have to convert the data from sql database to xml format.
I am a newbie to xml so please guide me how to go about it.
I have read samples about how to fill a dataset (use a query to get data from db and fill dataset)with data and transfer that into xml format.
The problem with this approach is our xml template has many nested rows.
Something like
<a1>
<a2>
<aa>somedata
<bb>somedata
</a2>
<a3>
<a31>
<a311>somedata
<a312>somedata
<a313>
<a3131>somedata</a3131>
</a313>
</a31>
</a3>
</a1>
I understand we have to use schemas to define datatype , the min occurence and max occurence and mandatory fields please let me know if it is correct?
Also I am not sure what approach must be used i don' t know whether to use xsl ot xsl fo to transform the xml output according to the template.
-- modified at 6:54 Tuesday 20th June, 2006
|
|
|
|
|
hai,
I m doing webdevelopment projects.I want to check the session expiration in a single page,thts without writing the same code in every webform's page_load.For tht,I want to know how to catch the pagename and execute the common code before the page enter into page_load() event.
Is there any possiblity in asp.net
For eg: I want to write this code
"if session("userid")="" then
response.redirest("session_ExpPage.aspx")
endif"
in a single place
pls reply my post as early as possible
Thanks in advance
Mekalaasri
|
|
|
|
|
|
Hai,
Thank for your reply
but my query is to catch the webform name (default.aspx) before it load into its page_load event , Is there any possiblity to catch the page in server place itself
I need to check the pagename and perform some action according to that.
Pls reply me
It is very urgent
thanks in advance
Mekalaasri
|
|
|
|