|
The thing about the provider classes is that you're not just limited to the default implementations, so off the top of my head I would suggest that you add an interface to the membership providers, called (say) IMembershipExtension which you use to implement common functionality on the two providers. Use this to store the role provider that goes with which membership provider. Then, you can use this to call the relevant IsInRole directly (unfortunately, you can't do this using the HttpContext.Current.User.IsInRole - you have to get the user and perform a bit of casting for the role provider).
We do something a bit like this with an extended version of the role provider and it works pretty well.
|
|
|
|
|
Thanks Pete,
Im currently exploring the possibility of adding some context to the FormsIdentityTicket's UserData to indicate which type of user we have logged in, and in a custom HttpModule replacing the HttpContext.Current.User (and Thread.CurrentPrincipal) with my own implementation of IPrincipal, still wrapping the FormsIdentityTicket, but having specific behaviour for each type of user.
That way I should be able to call HttpContext.Current.user.isInRole and fingers crossed.....
|
|
|
|
|
That could work, and it should allow you to use the PrincipalPermission where necessary (if you currently do).
|
|
|
|
|
OK - who the hell 1 voted this? Oh well - I'll 5 to compensate.
|
|
|
|
|
HI ALL
i am calculating irr and pass listarray created at runtime to irr function and i get error. as i'm new to .net
i have to calculate irr
textbox2.text specify the no installments
textbox1.text specify loan amount
textbox5.text specify the amount of installments
Dim i As Int16
Dim pay As New ArrayList()
For i = 0 To TextBox2.Text
pay.Add(TextBox5.Text)
Next
pay.Add(-TextBox1.Text)
Dim ir As Double
ir = Math.Round(Microsoft.VisualBasic.Financial.IRR(pay (TextBox2.Text + 1), 0.1), 2)
TextBox7.Text = ir
GET THIS ERROR MESSAGE
Unable to cast object of type 'System.Double' to type 'System.Double[]'.
|
|
|
|
|
Hi all
How to convert any type of audio or video file in to an swf extension and play it in a browser. I have searched a lot on net but in vain . My last hope is this forum. Please help me. Thanks in advance.
|
|
|
|
|
You won't find any free utility in .net. You can use php for this specific purpose.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
hai all,
i am new to .net.i am using .net 2005.i do my project in asp.net.backend is sql2000.
all employee ids are stored in sql 2000 database.
i want to get all employee ids from database and stored into single array name.then using that array name,i want to display the details of all employee ids in datagridview....how to do this?....
thanks in advance...
|
|
|
|
|
why do you want to store it in array? store it datatable instead
|
|
|
|
|
I want to show a dicom image file in asp net 2.0. Can anyone provide some help.......
Do good and have good.
|
|
|
|
|
hi
i want upload file on server.
and how to download it.
gayatri
Gayatri
|
|
|
|
|
niki_nilu wrote: i want upload file on server.
Use FileUpload control.
niki_nilu wrote: and how to download it.
Just redirect to that file. Response.Redirect("FileName.extension");
|
|
|
|
|
hi
yes i took input file control.
but where i will see that uploaded file.
my code is--
if (File1.PostedFile != null)
{
string StrFileName = File1.PostedFile.FileName.Substring(File1.PostedFile.FileName.LastIndexOf("\\") + 1);
string StrFileType = File1.PostedFile.ContentType;
int IntFileSize = File1.PostedFile.ContentLength;
if (IntFileSize <= 0)
Response.Write("<font color='Red' size='2'>Uploading of file " + StrFileName + " failed </font>");
else
{
File1.PostedFile.SaveAs(Server.MapPath(".\\" + StrFileName));
Messagebox.Show("Your file was uploaded successfully");
}
}
Gayatri
|
|
|
|
|
When you are using some one else code. Please try to understand it first.
File1.PostedFile.SaveAs(Server.MapPath(".\\" + StrFileName));
You are giving this path. So it will be uploaded there.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
niki_nilu wrote: if (File1.PostedFile != null)
If you are using ASp.NET file upload control use File1.HasFile
niki_nilu wrote: string StrFileName = File1.PostedFile.FileName.Substring(File1.PostedFile.FileName.LastIndexOf("\\") + 1);
string StrFileName = IO.Path.GetFileName(File1.PostedFile.FileName);
niki_nilu wrote: but where i will see that uploaded file.
In the same place where you are uploading it
|
|
|
|
|
niki_nilu wrote: but where i will see that uploaded file.
In the virtual directory of your web.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hi
i am using IE 7 browser.
i am using javascript for popup window.
this is worked on Microsoft internet explorer.
but same code not worked on IE7.
pls help me
my code
function openForm()
{
window.open("NewScore.aspx","Title","status=no,resize=no,toolbar=no,scrollbars=no,width=700px,height=580px,maximize=no,always on top=100 left=400");
}
and in codebehind----
btnAdd.Attributes.Add("OnClick", "openForm()");
so pls help me.
Gayatri
|
|
|
|
|
niki_nilu wrote: this is worked on Microsoft internet explorer.
but same code not worked on IE7.
IE7 and Microsft Inetrnet Explorer are same.
Probably you have popup blocker on.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Any javascript error you are getting?
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
hi
i have no error.
pls tell me what's problem.
its imp for me
gayatri
Gayatri
|
|
|
|
|
Try changing the settings in Internet Options, Open Popup windows in New Window/ New Tab. (by default tab). Change it to open in new window
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
I hope this will solve your problem...
btnAdd.Attributes.Add("OnClick", "openForm(); return false;");
puranonnet@hotmail.com
www.ibrinte.com
|
|
|
|
|
i need a text box by which user can enter time in hour:Min Formate
Ex 08:24 (Hr:Min)
i mean Text Box Which Allow user to Enter only 2 number Before : and 2 num after :
Raghvendra
|
|
|
|
|
Use regular expression to find value is in expected pattern. If you use this kind of textbox in many forms, I suggest making it as a custom control with all validation logic embedded. You can reuse it by dragging and dropping from toolbox.
|
|
|
|
|
Sir i need A test Box Which shows fromate Like( : )
So user can enter only 2 num Before : and 2 After : ,
so sir how i will make hole custom textbox , i mean could u plz give me some related code for it
Raghvendra
|
|
|
|