|
can you use the web.HttpResponse.Redirect method.
replace
<br />
application.Server.Execute("Error.aspx");<br />
application.Server.ClearError();<br />
with
<br />
HttpContext.Current.Response.Redirect("Error.aspx");<br />
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Unfortunately that doesn´t work. Using application.Server.Execute("Error.aspx") makes the aspnet process run error.aspx in the current page´s context, wich means that the exception is still available.
|
|
|
|
|
Hello,
In ASP.NET 2.0 how can I find the path of web.config file inside code at runtime.
For instance there is AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
But in my case I cannot use this. Because, my assembly is in at different place and web config file is at different place (wwwroot)
When I use above method, I get location of assembly, not the root folder i.e. wwwroot
Appreciate any help.
Note: I need to get this path where Server.MapPath is not available.
- ashish
|
|
|
|
|
You can only get the path when MapPath is available. If it's really not available, you have to store the value when it is, so that you can get it when it isn't.
If the code is run because of a request, you can always use MapPath. You can reach it through HttpContext.Current.Server.MapPath.
MapPath("~") gets the root folder. The root may or may not contain a web.config file. Each subfolder may also contain a web.config file.
---
b { font-weight: normal; }
|
|
|
|
|
Hello Guffa,
I have my virtual dir configured at drive X and my wwwroot folder is in drive C. The webconfig file I have to keep in wwwroot folder.
I am using Enterprise Lib for caching. The ConfigurationBuilder of this uses
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile to get config file path. In my case above statement does not return the value I am looking for that is, wwwroot folder path.
Inside Enterprise Lib’s ConfigurationBuilder class I do not have HttpContext available.
Hope you understand where I am.
Let me know if you have any clue, any workaround to get it running.
Appreciate your help.
- ashish
|
|
|
|
|
In addition to previous I can access right config keys by using
System.Configuration.ConfigurationManager.AppSettings
In web config only I have defined the path for appsettings.xml file and it reads properly.
- ashish
|
|
|
|
|
AshishBasran wrote: Inside Enterprise Lib’s ConfigurationBuilder class I do not have HttpContext available.
Why not? When is the code executed?
---
b { font-weight: normal; }
|
|
|
|
|
It get executed when on load of first page I try to use caching and for that from entprise lib request goes to ConfigurationBuilder for configuration section
- ashish
|
|
|
|
|
Then the code is executed as a result of a request, and you can access the current HttpContext.
---
b { font-weight: normal; }
|
|
|
|
|
hi,
I want a folder browser dialog control for asp.net. can any one help me?
sam.
|
|
|
|
|
I'm afraid that not possible without using an active x- control or a java applet on the page.
|
|
|
|
|
do u know any activeX control?
|
|
|
|
|
How would i pass values from one form to another?
Like if i want to retrieve a variable's value on the login form and use it on the home page?
thank you
Nothing lasts but nothing is lost
|
|
|
|
|
If your value is not very big then you can send it through querystring. From the login page you have to send the value through the URL and in the home page you can retrieve it from the URL.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Not a very secure method. After all the data you are passing would be in plain text attached to the url.
You could use a session variable to pass the values around
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Not a very secure method.
Quite correct. This method should only be used if the data is not that much valuable.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thank you it worked
Nothing lasts but nothing is lost
|
|
|
|
|
Always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Does the session variable pass like a quary string or does the server keep track of the session variable?
Chad Dolan
|
|
|
|
|
A session variable is maintained by the server and is not passed via query string
only two letters away from being an asset
|
|
|
|
|
Hi,
I have a table for users of a system. A datagrid is databound with the table's details. However, there is another table which stores the users' title(Mr/Mrs).
In the user table, it is a foreign key. How can I display Mr/Mrs on my datagrid and NOT a number ID representing the user title?
Any hint would help, Thank you in Advance.
|
|
|
|
|
From database itself you can get the title text with the user details using join in the query.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I think you ay have misunderstood me, or may i be i misunderstood you :S
Let me rephrase.
Currently, in my datagrid, if I add new user to the databse table "User", using the webform, this is what is displayed:
**Title****Firstname****Lastname****Username**
----------------------------------------------
**1****Joe****Blogs****jbloggs**
I want to replace that "1" with "Mr", which can be read from the "Title Table".
I think it may have something to do with views, a friend of mine advised.
-- modified at 10:46 Wednesday 23rd August, 2006
|
|
|
|
|
Hi,
Just make a join with the table which has Mr, Mrs, etc.. with this table like,
Select a.idfield, b.MrMrsfield as title, a.firstname, a.lastname, a.username
from nametable a, mrmrstable b
where a.idfield = b.idfield
and on the grid hide the idfield column, hope it makes sense for your requirement.
Ram
|
|
|
|
|
This makes complete sense.. Thank you for your replies.
There is something I'm missing tho. I will figure it out!
Thanks again.
|
|
|
|