|
Create a regular expression that repeats. Example for comma separated numbers: "\d+(?:, ?\d+)*".
---
b { font-weight: normal; }
|
|
|
|
|
I'm trying to find out what the best practices are, based on both security & ease of use, for users who are logged into your website.
I'm currently using a combo of session objects & forms authentication however I've experienced a few problems with forms authentication such as random logouts at inopportune moments and users being redirected to the login page while they're viewing a smaller popup window, so I'm looking to remove that feature from my web site & implement something else.
Does anyone know of a good tutorial for ways to properly setup user logins?
Thanks.
-Goalie35
|
|
|
|
|
well, I myself have been looking to improve my standard practice for asp.net authentication.
From what I've seen, the best practice is to drop using Session at all for storing anything related to authentication, and JUST use forms authentication. Now by default all you will know about a user at the beginning of a request is their "name" which will be their username. (you can access this with this.User.Name in any codebehind). Then you will likely need the UserId in order to do anything. You have 2 choices it seems. Either hit the DB on every request to grab the UserId from the username, or cache that pertinent information in the cache. the popforums.com source code has an example of storing it in the cache. For myself, I just hit the db on every request. Unless you're looking at an extremely high usage site, that extra hit won't cause any performance problems compared to all the other stuff going on in a page.
If anyone has any better ideas I'd love to see them.
|
|
|
|
|
If you're using 2.0, I would go with the Membership services.
|
|
|
|
|
please some one tell me how to get the login name of the logged user from active directory.
marp tech
|
|
|
|
|
Sure. What have you tried so far?
|
|
|
|
|
i've tried to get the login name from the http request (Request.ServerVariables) but in my machine i get the name right,from other computers i get (ASPNET user), so i get the name of the computer that has requested the page from http request then i create active directory searcher and loop through the result until i find the pc then i try to get its login name from the active directory but sometimes it would not work and i get some problems in my site bussiness rules due to the errors in the search.
So i need another way to do it.
Thanks.
marp tech
|
|
|
|
|
|
Hi,
Am assigning a dataset to dataview and trying to sort dataview.
But, its not sorting.
DataView dv = new DataView(DataSet.Tables[0]);
dv.Sort = "ColName";
Please help me as this is urgent.
rmr
|
|
|
|
|
The DataView doesn't sort the DataTable. Make sure that you are not still referencing the DataTable object, because the DataTable will still NOT be sorted. You will have to reference the DataView object to utilize the sorting. Otherwise your code looks okay, so if you need more help you'll have to give us some more information about how you are using the DataView object after you sort it.
Hope this helps.
|
|
|
|
|
Hi
Guys in my application,user has the option to convert the specific info shown to user in PDF format, incase of one user it's not working but it's working fine for other user, what can be expected reason plzzzz reply me ASAP,tahnkx for ur reply
|
|
|
|
|
Hi,
I was trying to send a number from a HTML textbox to add a value to it at the Server, then return it to an ASP textbox.
But I don't know to to pass the value of the HTML textbox to the server.
The 2 Javascript functions are:
//the first function to call the server
function GetNumber() {
UseCallBack();
}
// The function receive the adjusted value from the server and display it into the textbox1
function GetRandomNumberFromServer(arg, context) {
document.forms[0].TextBox1.value = arg;
}
Here are the server side code, written in the .vb file:
Dim _callbackResult As String = Nothing
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim cbReference As String = Page.ClientScript.GetCallbackEventReference(Me, _
"arg", "GetRandomNumberFromServer", "context")
Dim cbScript As String = "function UseCallBack(arg, context) {" & cbReference & "}"
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "UseCallBack", cbScript, True)
End Sub
Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult
Return _callbackResult
End Function
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
_callbackResult =
'equal the value from the HTML textbox + 5
End Sub
Does anyone know where I can add some code to ask to pass the value to the Server?
Thanks,
|
|
|
|
|
Hi,
As u show here your callback function can pass Argument to server...
U just simply put it on your UseCallBack Function of javascript...
Use
======================
UseCallBack("Argument u Pass","");
=======================
Now on Server Side U can get this value by RaiseCallBackEvent funtion
Like
=============================
_callbackResult =eventargs.ToString() // It written in C#
=============================
This way u can get Value from javascript to Server
-----------------
Viral
|
|
|
|
|
hi,
i want to know how to get system names which are connected in network
in C# ASP.net and databases name in the server.
kamalnath
|
|
|
|
|
Sure. What have you tried so far?
|
|
|
|
|
hi,
i tried with "System.Net.NetworkInformation" name space.is there any way to get the system names which are connected in network.
kamalnath
|
|
|
|
|
i add this template column to datagrid.
asp:TemplateColumn HeaderText="Image">
<itemtemplate>
<asp:image
="" width="150" height="125" imageurl="<%# FormatURL(DataBinder.Eval(Container.DataItem, "PersonID")) %>" runat="server">
in code behind in c# is
string FormatURL(string strArgument)<br />
<br />
{<br />
<br />
strArgument=strArgument+"1";<br />
<br />
return(strArgument);<br />
<br />
}
when running this it shows an error.what i do?
All I ever wanted is what others have....
CrazySanker
|
|
|
|
|
i have a column in my database with the type ntext ;
when i enter in this column a few Unicode charecters(150 charecters) and show that's works good
but when i entered in it the large number of charecters (for exam 700 chars) show me "?" instead of Unicode charecter
how can i solve it ?
With Thanks
MHF
-- modified at 6:31 Friday 6th October, 2006
|
|
|
|
|
You have to find out where the problem really is. The database field is capable of storing the characters, so it's either when you store the value, when you retrieve the value, or when you display the value that the problem is. Check the actual data before and after each of those stages.
---
b { font-weight: normal; }
|
|
|
|
|
Ok but why when i add the small text as same there isn't any problem ?
MHF
|
|
|
|
|
It has most likely nothing to do with the size of the text, but rather the contents of the text.
---
b { font-weight: normal; }
|
|
|
|
|
Hi! there is a data grid having 3 rows. back color of first row is red, back color of second row is green & back color of third row is blue. i want onmouseover the back color of an row become yello & onmouseout backcolor of row become previous color i.e. row restore its backcolor. how it possible?
samir
|
|
|
|
|
try this
http://authors.aspalliance.com/Colt/Articles/Article3.aspx
Thomas
|
|
|
|
|
hello
i have upload a zip file now i want to extract the zip file in my application.
how can i do it with asp.net
thanx
|
|
|
|
|
Hi,
I am Ravindra,learning ASP.net.
I created a webusercontrol and made a drag and drop on a webform but I dont know how to move the webusercontrol(.ascx) on a webform to place it correctly.So,if anybody knows please help...
thanks in advance.
Ravindra
|
|
|
|