|
Thanks I got it it work in C#
But how i can make it work in VB.Net
Thanks a lot
Assaf
|
|
|
|
|
I realy dont know VB now Long time dont use it ![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
If it works in C#, why would it not work in VB.NET ? Looking at the code you posted above, I think it's because you are not stepping through the repeater items, which is where the labels are.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, I've created a login page and I'm done writing code for the comparison of user input with user name and password stored in the database. Suppose I have 4 web pages, Page1, Page2, Page3, and Page4. If I want anonymous users to be able to access Page1, but require users to login to use the other pages, where and how do I set the requirement for each page to have that happen? I am confused by the article on the subject. It says that one can use the "allow" and "deny" tags of the "authorization" in Web.Config to set permission. What I'd like to know is can you specifically use that to set the permission of a particular page or does that apply to all pages. Thank you in advance for your help.
-- modified at 23:11 Sunday 29th July, 2007
|
|
|
|
|
hi
u need to save a flag variable in Session and in each page check if that flag have the right value on page load or and in eatch operation like update insert .
if the user name and password true
Session["flag"] = "true";
else
Session["flag"] = "false";
if ( (Session["flag"] != null) && (Session["flag"].Tostring == "true")
{
then can see the page
}
else
{
Response.Redirect("CantLoignPage.aspx");
}
I hope it help ![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Dunno what the other guy was talking about...
I'd create a base page class, which checks if the user is logged in, and, if not, redirects to the login page. You can elect to pass the calling page on the URL, so when they login, they get taken back to where they were, but you don't have to, for it to work.
Now, you have a base page which enforces login. Simply derive only pages that require login from this base page.
I hope you're not pulling any usernames or passwords from the database into your code ? You should check login by passing the username/password to the database and having it tell you true or false.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
u should use Session for the authorization..
1.In Page1 u allow anonymous user to access the pages
2.In the other page(Page2,Page3, and other page that need to login first) u have to insert a session check in code behind (*.aspx.cs) on event load
Example :
<br />
if((Session["username"]==null) && (Session["password"]==null))<br />
{<br />
Response.Redirect ("LoginPage.aspx");
}
note : u must declare Session (Session["username"] and Session["password"]) in u'r login page
Example :
<br />
Session["username"]==UsernameTextBox.Text;<br />
Session["password"]==PasswordTextBox.Text;<br />
Hope it can help
Regards,
Tomi
|
|
|
|
|
I am relatively new to ASP application development. I have created a database application that runs on the Web. I have now finished the application and it is running on my machine using the Localhost connection. Now I want to deploy it to the web and company intranet. How does one go about this? Do I have to compile the application as some pages contain a lot of VB .Net code or they are deployed as they are?
EmbassyPhiri
|
|
|
|
|
EmbassyChikafahPhiri wrote: Do I have to compile the application as some pages contain a lot of VB .Net code or they are deployed as they are?
You shouldn't have to in theory, as long as you don't have database connection strings hardwired into the code or anything like that.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have a FormView that is connected to SQL Server. I want to insert new record to it, OK. When I open the FormView I want one or more of the fileds to be a dropdown list or listbox that make the user choose one of the list that is in that filed. Also, the content of the dropdown list is suppose to be taken from a store data (from a table) in the database.
Thanks a lot for your help and I wish someone to help so that I could solve this problem...
-- modified at 4:00 Monday 30th July, 2007
|
|
|
|
|
|
How we can upgrade/change an Application Pool running process to System user?
I want to use HttpListener but there is no permission.
I can't change this option directly from server because this isn't a standard option.
How can i do this with scripting or etc?
Any suggestion will appreciate.
Thanks.
|
|
|
|
|
In fact my problem is working with HttpListener in server side to listen some ports like 8080.
No one can help me?
|
|
|
|
|
hello yaar,
Write the code in Web.config---->app settings or HTTP Handlers u will get.
ok
Murali
|
|
|
|
|
How can I convert(Parse) String to Time?
e.g. I have this varchar (4:30) in 24 hours style or (4:30 AM) and I want to parse it to Time?
What should I do?
Thank you for your help...
-- modified at 7:11 Sunday 29th July, 2007
|
|
|
|
|
hello
just try this code:
DateTime dt=Convert.ToDateTime([your string]);
msma
|
|
|
|
|
I put three dropdownlists in formview control.Two of them have OnSelectIndexChanged events.The problem is First one firing its own event but second one also firing SelectIndexChanged event of First one only when Item is selected...
TSRK
|
|
|
|
|
hi
i think that you create your first dropdown list and then copy it twice .
so i think you set the event_name for first one and so,second and third one have the event with same name of first one
so you can check the event name of them and set the unique name for every event of them
good luck
msma
|
|
|
|
|
Hello
This is My code:
<asp:Repeater ID="myRepeater" runat="server">
<HeaderTemplate>
<table border="2">
<tr>
<td colspan="5" height="30"><asp:Label runat="server" ID="LblName" Text="dddddddddd"></asp:Label></td>
</tr>
<tr>
<td>Grade Name</td>
<td>Institution Name</td>
<td>AcomplishesYear</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem, "GradeName")%></td>
<td><%#DataBinder.Eval(Container.DataItem, "InstitutionName")%></td>
<td><%#DataBinder.Eval(Container.DataItem, "AccomplishYearNum")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
what i want to do is to write instead "ddddddddddd" in the header a real Data comming from a Session?
it's mean how i can refer to this label in the repeater from the VB code
("I want to say sorry to christin Garus I didn't get his point" if he can clarify it to me, thanks christian)
Thanks in advance
Assaf
|
|
|
|
|
Assaf82 wrote: instead "ddddddddddd" in the header a real Data comming from a Session
You can feed the value of session to the Label from CodeBehind right?
Assaf82 wrote: christin Garus
His name is Christian Graus right?
|
|
|
|
|
How i can refer to the label inside the repeater, from the code behind
to set his value
-- modified at 11:00 Sunday 29th July, 2007
Assaf
|
|
|
|
|
Oh, I remember this now.
You keep asking questions in new threads, and each time, progress in trying to make sense of your question is lost. Please stick to a thread, so people can follow the things you fail to explain.
As I explained before, you can use the <% tags to call a method in your code behind, or just to grab the value from the session. If you couldn't follow that, you really should buy a good ASP.NET book and read it, because it's reasonably straightforward.
in your code behind
protected string GetValue()
{
string s = Session["theString"];
return s ?? ""; // This just returns "" if the string is null
}
in the aspx
Text='<%=GetValue()%>'
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, would you please point me to a good tutorial on authenticating a user with a database. I have read about user authentication using Web.Config but since it does not suit my need I would like to use database to authenticate my user. Thank you in advance for your help.
|
|
|
|
|
Are you trying to do this with database users or with a user table (containing username, password, etc) in the database?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi, I'm planning to store user names in the UserName field and passwords in the Password field of my Members table. Then I'm planning to check the text value of the TB_UserName text box and the value of TB_Password text box against the database. So I guess I'm using a user table. I don't know what else to do other than what I've just described. Thanks for your response.
|
|
|
|