|
Hi,
I have a website developed using Forms Authentication with the SqlMembershipProvider.
The host has set Medium Trust Level, which results in reflection being disabled.
When I access the page that has the login control, I get the following security exception:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I have dug into some information about forms authentication in ASP.NET 2.0, and as far as I can find out, forms authentication uses reflection to determine the provider to use.
The website is currently running on a webserver that does allow reflection, but I have to move to another provider because of several issues. Almost every hosting provider uses the medium trust level on their shared services. We do not want a dedicated server (too expensive and not necessary).
This is a snippet from the web.config where I set the membership provider and the profile.
<membership defaultProvider="ArtistSqlMembershipProvider" userIsOnlineTimeWindow="30"><br />
<providers><br />
<remove name="AspNetSqlMembershipProvider"/><br />
<add name="ArtistSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="30" passwordStrengthRegularExpression=""/><br />
</providers><br />
</membership><br />
<profile defaultProvider="AspNetSqlProfileProvider"><br />
<properties><br />
<group name="Personal"><br />
<add name="FullName" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
<add name="AddressLine1" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
<add name="AddressLine2" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
<add name="AddressLine3" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
<add name="Country" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
<add name="PhoneNumber" type="System.String" serializeAs="String" allowAnonymous="false"/><br />
</group><br />
<group name="Privacy"><br />
<add name="ShowEmail" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
<add name="ShowAddress" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
<add name="ShowPhoneNumber" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
</group><br />
<group name="Authorization"><br />
<add name="AdminRights" type="System.Collections.Specialized.StringCollection" serializeAs="Binary" allowAnonymous="false"/><br />
</group><br />
<group name="Activity"><br />
<add name="AdminCurrentVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
<add name="AdminPreviousVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
<add name="PublicCurrentVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
<add name="PublicPreviousVisit" type="System.DateTime" serializeAs="String" allowAnonymous="false"/><br />
<add name="IPAddresses" type="System.Collections.Specialized.StringCollection" serializeAs="Binary" allowAnonymous="false"/><br />
</group><br />
<group name="Notification"><br />
<add name="TradesSalesDigest" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
<add name="ForumDigest" type="bool" serializeAs="Binary" allowAnonymous="false"/><br />
</group><br />
</properties><br />
</profile><br />
How can I resolve this?? Should I use another way of providing the forms authentication (and thus write the entire handling of the users myself)?? Can I come around the reflection another way??
modified on Sunday, March 30, 2008 5:33 AM
|
|
|
|
|
I have a web app that runs a bunch of SSRS reports in the background, i settled on running each reports (up to 30 ata time ) on different threads, and it runs lightning fast, generating all of them almost simultaneously. Then i was asked to display the results (namely success or failure, and if failure, what caused it) to the page. my question is, is it possible, and if so how do I write the results from the threads to a page while they run.
I have run loops in the past and used Response.Flush() after Response.Write() to display the results, but things start to get hairy when using multiple threads.
Any ideas?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Well I think the first thing to do is to synchronize the output. I assume you some class that is controlling all the threads. This class should compile the results. Then your page can get the information through a web service you call client side. You can use the output to update your we b page. Or perhaps another option would be to implement the ICallbackEventHandler interface and have some client side code on a timer.
modified on Friday, March 28, 2008 12:07 PM
|
|
|
|
|
Hello ,
I want to know how can I make a call to a webmethod with a private key and certificate. I mean the server expect the webmethod to send messagedigest with the web method call.
Please suggest.
Regards,
Pavas
|
|
|
|
|
In my Web.config file,authentication mode is "Form" and login url is "Login.aspx" which is in root directory.when i am calling a page which is in sub directory,then my page should automatically redirect to "Login.aspx" for authentication.but my problem is that instead of redirecting the page to "login.aspx" in root directory it searches in the same sub directory hence it does not get a file.
But when i am working offline ie on local PC,i don't get this problem.when i have uploaded this project on server i face this problem. Thank u.
coolsatty
|
|
|
|
|
I think you may need to specify the entire path of where your login.aspx page is rather then just ~/login.aspx
|
|
|
|
|
I tried putting entire path but it still searches in sub directory.Is there any settings in IIS because here in my PC its working fine but at server(handled by third party)side i am getting this problem.
coolsatty
|
|
|
|
|
I believe your problem is a result of your file path being relative. Ensure that your configuration references the file from the website root. In your case, ~/login.aspx should work.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Hi,
Try "~/Login.aspx".
Faraz Shah Khan
MCP, MCAD.Net
Blog
|
|
|
|
|
tried it but still the same problem.
coolsatty
|
|
|
|
|
Hi,
this is from my project
<authentication mode="Forms">
<forms name=".ASPXFORUM" loginUrl="~/index.aspx" protection="All" timeout="180" path="/"/>
</authentication> and it works absolutely fine with me.
Faraz Shah Khan
MCP, MCAD.Net
Blog
|
|
|
|
|
hi,
this is my code for uploading the file on server :
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
<br />
string savepath = @"ftp://66.197.198.204/ansarishan.somee.com/";<br />
if (FileUpload1.HasFile)<br />
{<br />
string filename = FileUpload1.FileName;<br />
savepath += filename;<br />
Label3.Text = "Your File has Upload as" + "" + filename;<br />
FileUpload1.SaveAs(savepath);<br />
}<br />
else<br />
{<br />
Label3.Text = "You Did not Specify a File To Upload";<br />
}<br />
}
But when i try to upload any file then an exception raise :
The SaveAs method is configured to require a rooted path, and the path 'ftp://66.197.198.204/ansarishan.somee.com/Winter.jpg' is not rooted.
although i can drag/drop files on "ftp://66.197.198.204/ansarishan.somee.com/" manually
what is the meaning of "rooted path"?
where is problem ?
|
|
|
|
|
i think rooted path is the root folder, i.e. bottom level folder, you may need to change your ftp as it could be dropping to a specific place rather then an root place
hope that makes sense
|
|
|
|
|
The SaveAs method will attempt to save your uploaded file to disk on the server. As such, it will accept only a legal physical path (relative or absolute) on the machine, or a network share path. For example: c:/users/me/documents/uploadedFile.txt .
If you need to move the file to an ftp server, you'll need to open a network connection and perform the ftp transfer as a separate step. Have a peek at this article[^] to get started with sending your file via ftp through code.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
both are correct...but where i define the ftp path......and this ftp obviously has username and password so,where i define the username and password.
|
|
|
|
|
You can't get there from here. Not directly.
You will need to either use an FTP library or perform the FTP transfer using the FTP protocol directly. The first option would be my recommendation. Please reference the article that I linked for you.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
yesss....i found
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
string savedir = @"\Folder\";<br />
string apppath = Request.PhysicalApplicationPath;<br />
<br />
if (FileUpload1.HasFile)<br />
{<br />
string savepath = apppath + savedir + Server.HtmlEncode(FileUpload1.FileName);<br />
Label3.Text = "Your File has Upload as" + "" + FileUpload1.FileName;<br />
FileUpload1.SaveAs(savepath);<br />
}<br />
else<br />
{<br />
Label3.Text = "Your Did not Specify a File To Upload";<br />
}<br />
}
thanks
|
|
|
|
|
Hi,
Does anybody knows how to add button to ASP.NET Wizard control,
I mean, button right or left to standart buttons (next, previous, finish)
Regards,
Alexander.
|
|
|
|
|
I have a user control with dynamically created textbox,dropdown ect..
When I try to access that .ascx controls in main page, first time it’s not taking any names and values.
But if I put break point and if navigate step by step by press f11 and f10
It’s taking all the controls name with values. Why it’s happening? How to solve this problem?
modified on Friday, March 28, 2008 9:39 AM
|
|
|
|
|
Unfortunately, there isn't a lot of information to work with in your original post, but when the question revolves around dynamic controls, the answer typically has something to do with the order of events.
Can you expand a bit on when you're creating your controls (what method), when you're attempting to access them (what method), and how you are attempting to access them? That may help to shed some light on what is causing your difficulties.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Hi friends
I need to get symbol using javascript.
for example if I pass £ then it should return pound symbol in alert.
Can anybody help me?
please don't forget to vote on the post that helped you.
|
|
|
|
|
think there is something in here that may help you
Just to confirm do you want to stop people passing a £ symbol through?
http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp
|
|
|
|
|
I want symbol if I enter its code.There is no any function like this.
please don't forget to vote on the post that helped you.
|
|
|
|
|
Sorry I dont understand what you mean
|
|
|
|
|
If you want to see the same thing that was pressed, then you just need to call alert with the parameter, surely ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|