|
You are so appreciated to help me.
I add some code in Global.asax
void Application_BeginRequest(object sender, EventArgs e)
{
// If the requested file exists
if (File.Exists(Request.PhysicalPath))
{
return;
}
else
{
// find in database
// get the correct url, and save to the CorrectURL
Context.RewritePath(CorrectURL, false);
return;
}
}
BTW, my web is coded under ASP.NET 2.0.
Any suggestion, kindly let me know.
|
|
|
|
|
We are in the middle of an asp.net class.
The teacher started going over creating custom controls, and it looked like a lot of coding for a simple dropdown. So we asked why we couldn't inherit the DropDownList, and customize from there. He hadn't tried, but it seems to work! The only problem is, in design time when you select the instance of the custom control and change a property it seems to initialize the web control!!! When you look at the code in the .aspx, it has added the actual dropdown html code to the page. So when you run it now, it has two of every item in the dropdown. Has anyone ever heard of this? Hopefully I explained well.
Juanito was here
|
|
|
|
|
I've set my web app to use Authentication mode = forms in the web.config
The problem is that when the cookie expires, it redirects to the login page -- but only in the main frame. I need to redirect the entire page (_top), not just a single frame.
1. Can I set a target (in the web.config) for the redirect that happens when the cookie expires? Target does not seem to be one of the parameters that it accepts for the forms element...
2. Can I handle the authentication timeout with javascript (so I can redirect to the login page, but specify a target)?
3. I could give the timeout value a huge number, then handle authentication timeout via some other method (this does not seem to be the optimum solution).
Any input would be welcome.
|
|
|
|
|
Hi All,
I have a horizontal Asp.Net menu control. Each of the parent "MenuItems" has sub menu elements, each with varying entries, such as:
Help
Test
AnotherTest
A Test
The whole submenu expands to the longest entry, however only the text for each submenu item is clickable, rather than the whole menu item. So whilst all of "AnotherTest" is clickable, the entire space after "Test" isn't.
What I'm really after is something like CP's "Message Boards" etc menus top right ^. Can anyone advise how to do this?
Thanks,
Martin.
|
|
|
|
|
Under the covers the asp.net menu is really just a table with the menu items being links in the table cells. If you want the entire area the be active you'd have to resort to a HTML or CSS based menu. There are plenty available.
only two letters away from being an asset
|
|
|
|
|
As Mark said, it's just tables and that stuff.
And that's where the problem is located. The solution? "ASP.NET 2.0 CSS Friendly Control Adapters 1.0[^]".
Once you applied them, it should be rather easy to adjust the CSS to make the items clickable as you asked.
|
|
|
|
|
Thanks guys - as soon as Microsoft stop arsing about with www.asp.net, I'll download the CSS adapters and give them a whirl.
|
|
|
|
|
I'm not sure if this is the correct forum for this question, but I'll give it a try.
I want to execute a DOS application from a ASP.NET webservice (code snippet below). The issue that I am having is that when the process is started, the "cmd" is running as "User1" and "DOSApp" is running as "ASPNET". The "DOSApp" cannot access the machines networked resources using the "ASPNET" user. Is there a way to change the user under which this "child" process is running?
<br />
Dim StartInfo As New ProcessStartInfo<br />
StartInfo.FileName = "c:\DOSApp.exe"<br />
StartInfo.Arguments = "-a arg"<br />
<br />
StartInfo.RedirectStandardError = True<br />
StartInfo.RedirectStandardOutput = True<br />
StartInfo.UseShellExecute = False<br />
StartInfo.Verb = "runas /noprofile /user:MyMachine\User1"<br />
<br />
Dim proc As System.Diagnostics.Process = System.Diagnostics.Process.Start(StartInfo)<br />
|
|
|
|
|
As a security measure the ASP.NET account has limited rights. It IS NOT advisable to even attempt to run executables on the server from within ASP.NET. Think about it, would you want anyone to log into your website and run executable code on the machine? If you don't think this is a problem, then give me the URL, and plan to rebuild your system, after I extract all the data.
only two letters away from being an asset
|
|
|
|
|
You would need to create a new app pool set the identity to the user you want the web service to run under. You need to add this user to the IIS_WPG group. You may need to give that group access to the thing you want to access as well. Then in the web service make sure it is using the new app pool you have created.
Hope that helps.
Ben
|
|
|
|
|
I have the following line in the Web.config
<identity impersonate="true" username="User1" password="secret1">
Wouldn't this accomplish the same thing?
|
|
|
|
|
I can't see the web.config code since you didn't check the Ignore HTML tags check box when you posted your code. Anyway, I am guessing that you are doing impersonation.
Something like:
<configuration>
<system.web>
<identity impersonate="true"
userName="contoso\Jane"
password="E@1bp4!T2" />
</system.web>
</configuration>
That does work, but then you have to store your password in clear text unless you use the encrption option. So I guess it is up to what you think will be more work. Either way you would need to add the user you are impersonating to the IIS_WPG group for proper access.
Ben
|
|
|
|
|
What is DOSApp.exe? If it runs on command prompt then you may try to run the cmd.exe and then set its working directory to C: and set arguments to DOSApp.exe
or something like the following
Dim psi As ProcessStartInfo = New ProcessStartInfo("cmd.exe")
psi.UseShellExecute = False
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
psi.RedirectStandardError = True
psi.WindowStyle = ProcessWindowStyle.Minimized
psi.WorkingDirectory = "C:/"
Dim proc As Process = Process.Start(psi)
Dim sIn As System.IO.StreamWriter = proc.StandardInput
sIn.WriteLine(String.Format("DOSApp.exe")
after this you can issue threading.sleep if you want to wait.. or you can
sIn.WriteLine("EXIT")
proc.Close()
sIn.Close()
I am using this code in windows application running on the intranet.. not web
-----
|
|
|
|
|
Thanks, I never thought of doing it this way. Unfortunately, the same result.
Even using
StartInfo.Verb = "runas /profile /user:MyMachine\User1"
The "cmd.exe" is running under "ASPNET" and the "DOSApp.exe" is also running under "ASPNET".
Is it possible to change the user and the profile on the process associated with "cmd.exe" before I send the "DOSApp.exe" string?
|
|
|
|
|
You are looking for something like this one [^] (my own article :->)
|
|
|
|
|
I also have the some problem. Have you sovled the question?
|
|
|
|
|
Hi Guys,
Today i am facing problem with dynamic controls.Thing is
I have a dropdown combo which is having list.i have button and UserControl. when i select dropdown value and click on button i should add control usercontrol dynamically using placeholder[This is working fine]. when i click on the save button i was not able to get the controls using this.FindControl("validControlName"); the findcontrol method is returning null.
when i click on the AddControl button it is adding control correctly and when i click on save i was not able to see control in server side reference using findcontrol method. I made sure enableviewstate to true.
Pls help me out to solve this if u find time. I will appriciate your immediate help.
sri
|
|
|
|
|
When a post back occurs, as in the button click, the page is recontructed on teh server side and uses the viewstate to populate any fields. Because your user control is added dynamically, it is not available to logic that recreates the page. (Simplistic explaination, more detail is involved) http://www.15seconds.com/issue/020102.htm[^]
only two letters away from being an asset
|
|
|
|
|
I am getting the following error
The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.
Mahammadhusen
|
|
|
|
|
And...
A little more detail would be helpful
only two letters away from being an asset
|
|
|
|
|
hello everybody,
i need the information regarding .net certification(including all the details).
could u please help out.....
suhasini
|
|
|
|
|
|
Go with Microsoft .Net Framework 2.0 Application development foundation self paced Training kit MCTS Exam 70-536. written by Tony Northrup, shawn Wildermuth with Bill Ryan of GrandMasters.
This book is available in market with the cost of Rs.795.
For more Details about the Certification visitHere[^]
Regards,
Satips.
|
|
|
|
|
Will this give me an MCP certificate, if i clear it. I have less experience in ASP.NET, so I was looking for a C# 2.0 exam.
|
|
|
|
|
Hi Friends,
How to integrate Limelight Server with ASP.NET. Limelight Server is a Server which stores multimedia contents such as Video and Audio files
Can anyone give me suitable link or advice on Limelight Server and its integration with ASP.NET application.
|
|
|
|