|
Try capital ID and make sure the ID value is unique on the page
<asp:textbox ID="txtUsername" runat="server" />
Wait, nevermind, you're using VB, could be anything then.
led mike
|
|
|
|
|
Dim currentUser As New DAL.AppUser
currentUser = currentUser.AuthenticateUser(txtUsername.Text, txtPassword.Text)
If currentUser.AppUserId > 0 Then
=====================================
where is this in the code behind? is this on page load? or page init?
when the page is submit and then loads those text boxes will be blank when the code goes for them.
also when you step through the application and you go one step past the txtUsername, what is the value then? is it still "" for currentUser?
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
The code behind is on login.click button event
|
|
|
|
|
if i had to guess it's because the page is posting back to itself when "login" is clicked and then you're code to collect the information is processing after the post back.
otherwise...i have no idea
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I tried setting AutoPostBack to true and setting a string var on the txtUesrName_TextCahnged event but it show TxtUsrName.Text as NULL also so I am pissed at this point. Its a copy of another site that works fine. It must be some corruption in the asp page.
|
|
|
|
|
I think it's asp:TextBox, does the other one work with this capitalisation ?
Do you have code that sets the username value anywhere, such as page_load ?
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 )
|
|
|
|
|
I rebuilt the whole page and problem fixed.
|
|
|
|
|
Hi,
I am working on this web application that needs to allow the user to upload files. The problem I am having is that when I upload a file with a pound sign, and try to access it I get an error. For example, the file 'AMS.doc' would upload fine to the server and when I try to download that file when it shows up in my grid, everything will go as expected.
However, if I rename the file to 'AM#S.doc' and then upload it, it will get uploaded to the server and the file name will get saved to the database, however, when I click to try to download that file, I get an error message. Is there a way to fix this? I have tried Server.UrlDecode and Encode, as well as HtmlEncode and decode, and none have fixed the issue.
Thanks,
TheMajorRager
|
|
|
|
|
What kind of error are you getting? Are you sure it is trying to access it the same way it is stored in the database? Sometimes when you pull things out of the database, if it thinks there is a SQL Injection risk, it will stop reading.
It would help to get an error message, and some relevant code...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi all,
I have many Messages in web.config file:
for example:
1-Could not find schema information for elemect
'http://schemas.microsoft.com/.netconfiguration/v2.0:configuration'
2-could not find schema information for attribute'name' here:
<add name="FirstName">
3-and etc...
why these messages occure?
Is these messages a reason of that i can not connect to my database?
thank you,
Hoda
|
|
|
|
|
They could be, and probably are. All files should have no issues if you expect to be able to have everything work.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
This does not affect your connection to the database.
This has to do with the version of .NET your web config is calling for and the .NET configuration that's actually installed.
Is this web config left over from a beta .NET version?
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
Hey guys,
Using C#: To hide a column in my datagrid I'm using the code
grid1.Columns[4].Visible = false;
The column I am hiding is a bound column. Is there a smarter way to go about this rather than using an index number to hide the column since it will no doubt come back to bite me when I need to add/remove columns from my grid in the future.
Thanks for your help.
~Chris
|
|
|
|
|
are you auto-populating columns?
you could always customize the "Select" command in the data source and remove in unnecessary fields being entered in.
you can do this in the menu's or right in the .aspx code.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I'm not auto-generating the columns in this instance, but if I was, I understand what you're saying.
So in my case here, am I stuck using a hard coded number to hide my column or is there a way to programatically find the column number of the column I want to hide?
Thanks again.
|
|
|
|
|
if you want to hide it without doing it hardcoded...why not just take out that column from the result set that the grid shows. you could still use a where clause against the data.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
The columns are defined before runtime so I can't take it out of the result set.
|
|
|
|
|
So question...how do you bind the data? in the code behind? or do you use gridview / data source controls and "edit the columns" in the GUI?
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I'm using code to bind the data. I also have some template columns in my grid that aren't populated from my data source (sql server).
|
|
|
|
|
Okay what about
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if block here...
e.Row.Cells[0].Visible = false;
}
this is runtime and you could put an if block in to handle the logic.
or:
GridView1.DataBind();
if (GridView1.Columns.Count > 0)
GridView1.Columns[0].Visible = false;
else
{
GridView1.HeaderRow.Cells[0].Visible = false;
foreach (GridViewRow gvr in GridView1.Rows)
{
gvr.Cells[0].Visible = false;
}
}
if that helps
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I have a bit of a problem whereby I want a single control page to have several list boxes and several buttons on it.
The list boxes are dynamic based on what was selected in their parent list box. The list boxes use autopostback "__DoPostBack" to allow
efficient interaction.
However, when a button is clicked the form should be posted back to the server to a different aspx page and also in
a different target window.
The control page is essentially allows a user to drill down information via the select boxes. Once they have found the
info they are wanting, they can then click one of four buttons which will each display a different report in a new
window.
Unfortunately, currently, when we set the form targat and action to accomodate this, once the new window opens and
we return back to the control page to find some more information to view more reports etc. it still retains the same
target and action of the previous report view.
can you help
|
|
|
|
|
Hello
some one can help me
i have to create a model security where a user login have a role
next the application can refuse the access only a one component (example refuse a use a button o panel)of the page asp net
some one know article model security
regards
|
|
|
|
|
if users have roles you should be able to use the web.config file to set up a restriction on any single .aspx page or a folder.
for example:
</system.web>
<location path="admin.aspx">
<system.web>
<authorization>
<allow roles="admin" />
<deny users="*" />
</authorization>
</system.web>
</location>
</configuration>
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
Hi,
I have a GridView on a Default.aspx site, and when i click select ont the right field, then go to ShowUser.aspx?ID=23
How do i get the DetailsView to understand that then will show ID=23 when you select that id on default.aspx?
Hope you get it
|
|
|
|
|
you mean you want to "show more details" when someone clicks on an item in the gridview?
if that is correct, this goes thoroughly over this topic:
http://www.beansoftware.com/ASP.NET-Tutorials/GridView-DetailsView.aspx[^]
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|