|
You should be able to put it in
HttpContext.Current.Items
or at the very least share it through the session.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
If the object contains simple types, add the serializable attribute to the class and use a session to pass it throughout the session.
|
|
|
|
|
Thanks for the quick replies!
Let's see if I understand this option correctly:
I added the serializable attribute and then used the LosFormatter to give me a long, Base64 encoded string. By using s session, you mean to save this long string on a sole session variable? Is this - performance wise - better than sending the same string through a hidden input?
|
|
|
|
|
If the class uses simple types, there is no reason for anything more than the serializable attribute.
If the object (in your case, User Info) is going to be used across many pages, session would be a better option.
|
|
|
|
|
Hi,
One of my clients started developing a new web app in ASP.NET 2.0. After a couple of months into development, they decided it was taking too long, that the same app would take them 3-4 months to complete in ASP, and then they would migrate to ASP.NET 2.0.
I am wondering if there is anything they can do now in the new ASP app that would make migration to ASP.NET easier. For instance, would it be easier if they, and can they, use VS2005 to develop the new ASP app? Can they develop the new app over ASP.NET 2.0 and have the old ASP Server classes such as Server, Request, Reponse, etc., available to them? Or rather what will they not be able to do in the classic ASP way, in VS2005 and .net 2.0, that they could do when it was just ASP? What are the big hurdles that typically come about when code is ported from ASP to ASP.NET, and could they do something now, in the new ASP code base to prevent that?
Any info is appreciated.
Thanks.
-Shefali
|
|
|
|
|
You can do classic ASP style coding in ASP.NET 2.0, not that I'd ever want to. You can just open an aspx page and hack at it just like you did with ASP, but you lose a lot of the ASP.NET features. I'd see what they are having trouble with and guide them in the right direction for the new platform before I helped them take a step backwards like that. Also, Server, Request and Response are all there in ASP.NET it would be difficult to write any real application without using them, so that question makes me think they aren't understanding something about ASP.NET and are making things harder on themselves.
They are just delaying the inevitable by going back to ASP and it is going to take longer for them to do the port then they would have lost learning ASP.NET.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
we have an issue where we recently reset a service account's password. the password begins with a special character (one of these !@#$%^&*()~). I was wonderingif anyone has ever heard of ANY of these causing issues with authentication when using a specified account for impersonation in a web.config file.
we keep getting this error:
Could not create Windows user token from the credentials specified in the config file
and it is locking out the account.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Have you tried using a pw that does not have a special character at the beginning, and tested it? Most password rules mandate a special character not being in the 1st position. Maybe there's a reason for it.
|
|
|
|
|
You learn something new every day. I was able to test it with another account that does not have a special character at all in the password and it works, but the problem with that is obviously we cant tell if the password or the account is the problem....
You have given me something to think about though.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
How can I resize the dropdown portion of a fixed dropdown list when the user clicks the dropdown arrow with ASP.NET and C#.
|
|
|
|
|
When this question was posted before, I spent some time researching it and couldn't find a way to do it. I might be wrong, but it seems to be controlled by the browser.
|
|
|
|
|
Hello fellow developers!
I'm currently working on a website in which users should be allowed to log in. We have an existing user database (SQL Server 2000), and I would like to use this database along with the ASP.NET login controls. Is this possible?
I've been researching and found out that a possible solution would be to implement my own version of the MembershipProvider abstract class. Before I wander down that dirty dark road, I would like to know, if there is an easier way. I thought perhaps it would be possible to configure the SqlMembershipProvider to fit my needs.
We are unable to change the design of the database since it is part of an existing system.
Best regards
Soeren
|
|
|
|
|
If you're looking to use the existing database for login validation then all you need to do is handle the OnLogin event of the Login Control and authenticate against it. No need to implement a Membership Provider.
only two letters away from being an asset
|
|
|
|
|
Okay. Looks nice.
I assume this is what you want me to do:
<asp:Login runat="server" ID="loginBox" OnLoggingIn="LogMeIn">
</asp:Login>
And in the "LogMeIn" function I should implement my login validation.
Can I be sure, that this will override whatever build in authenticate methods the login contol may have? The reason I'm asking is because the standard setup seems to work against some database in my App_Data folder, without any code at all.
Best reagards
Soeren
|
|
|
|
|
Oh well stupid me just found out what I think you meant!
The solution must be to inherit the Login class, and implement your own version of
protected void OnAuthenticate(AuthenticateEventArgs e)
Inside this you do your user validation stuff and set the "e.Authenticated" property to true - if the user validates of course - otherwise false.
It seems to do the trick for me.
If (I'm totally wrong)
please correct me! :-);
Best regards
Soeren
|
|
|
|
|
Not at all what I meant.
1) Drop the login control on you page
2) Implement OnLoggingIn handler
3) Authenticate user in any way you choose
4) Call FormsAuthentication.RedirectFromLoginPage
Simple as that, no need to create a derived class
only two letters away from being an asset
|
|
|
|
|
hi,
i want to display images as a dropdownlist items
can anyone help me plz
thanx
rony
|
|
|
|
|
I don't think this is possible!
Best Regards
3ala2
|
|
|
|
|
Hi Developers
I have a datagrid contains Tasks in a Queue. Now I need to move tasks up and down with two Up and Down (in each row of Grid).
Note: Grid should Refresh after clicking on up/ down arrow and records need to be updated in database also.
Please let me know if you know further explanation for that.
Thanks in advance
Lets work it Out.........!
|
|
|
|
|
You need to have a sort order column, probably an int, that gets updated when the user clicks on one of the arrows. The column is updated and the gridview is refreshed and all is right with the world.
only two letters away from being an asset
|
|
|
|
|
Hi
When i set the attribute 'requestLengthDiskThreshold' in web.config file under <httpRuntime /> tag im getting the following error
"The attribute 'requestLengthDiskThreshold' has been locked in a higher level configuration."
But its working fine locallly. when i work on web server im getting this error.
Please inform me any idea related to this..because its very urgent for me
Regards
RPL
-- modified at 8:00 Wednesday 13th December, 2006
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
This would suggest that a higher level config file (such as machine.config) is locking the attributes. This is normally done like this:
<configuration>
<location application="App1" allowOverride = "false">
<system.web>
</system.web>
</location>
</configuration>
Unfortunately, you cannot remove this at the level you are at. It is a feature to prevent you from overriding server settings that could compromise the server.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete
Please give me any idea to solve this problem.i need to upload over 10MB size of file on my web server.
Regards
RPL
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
RPL - sorry to say, but if you're on a commercial web server then you probably aren't going to be able to do this via the upload file option because, as I stated earlier, the machine.config file has locked down parts of the settings.
Can you use FTP to transfer the file up instead?
Alternatively, you need to get your web host to relax the rules for your application.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hai friends,
this is kishore,
i have one requirement importing data from excel to database, it should be done at server side
it is very urgent need
i could get succeed in exporting database to excel ,but iam unable to import excel to database
actually i have got the solution
but it is giving some problems, it is working only for one workbook(excel)
the code is below
'Getting a file path
If Not FILE1.PostedFile.FileName = "" Then
FilePath = FILE1.PostedFile.FileName
End If
'Excel Work Sheet Database Connection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=" & FilePath & "; " & _
"Extended Properties=Excel 8.0;")
'Select the data from Sheet1 of the workbook.
'FilePath comes as c:\export\mydata.xls
Dim f As Array
f = Split(FilePath, "\")
Dim k As Integer = f.Length
Dim str As String = f(k - 1)
Dim filename As String = str.Substring(0, str.LastIndexOf("."))
'' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [" & filename & "$]", MyConnection)
DS = New System.Data.DataSet 'DataSet
MyCommand.Fill(DS) 'Filling The dataset
please help me, when iam going to export the data from database to excel, it is storing it as c1.xls(we give) and sheet1 name is also stored as c1.xls
when i am going to retrieve the data from it, it is giving an error
please help me
regards
kishore
|
|
|
|