|
Hello Folks ,I am new to .net i just want to know how we diplay welcome username if the user login my data base is oracle 10g can u tell me how we display welcome username and logout link when user signin from login.aspx, i taken three hyperlinks one is login,logout and for signup and one label on the header page . Its is comman to all pages when i click login it has to go to login.aspx and for logout it has to go to logout.aspx . for sign up it redirects to register page . when the user register it goes to listing.aspx and from there i need to get welcome username and logout link untill he press signout now when user clicks logout the page refreshes and goes to login.aspx and logout and welcome username should be disable instead of that place i need login and signup.( I will tell u one example like user register with name as jack then i will get display image as welcome jack, signout ) when they press signout then this welcome jack and logout diable instead of that place comes as signin and signup.
I really need help man can u tell me how the usercontrol knows that this person is login .and displays welcome so and so name. we already created login page but before we never put signin and signup clients wants to add this and when they press signin it redirect to login page and when they register then i will get welcomeusername and signout .
Folks help me out .
|
|
|
|
|
You should have edited your existing post, instead of creating new ones.
Which bit of this is troubling you ? I'd imagine that once someone is logged in, you could store their name in the session, and create a control which renders it from there. Do you need help with that, with logging them in at all, or what ?
I assume you have a programming background in general, or are you completely new ? If the latter, you should work through a few books before you have clients. Either way, you should really know a technology before you have clients who are paying you to work in it.
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 )
|
|
|
|
|
Hello Christian, Thanks for ur reply
yeah i know we have to store there names in session , what if they are 20,0000 users and when ever signup we will show him welcome name, logout . how the user control knows can u give me one sample code . ok this is my code its working but its showing only welcome and signout , when the user not register then we will show him signin and signup. when user login then we show him welcome user , logout link. when user click logout then pages refreshes then it redirect to login.aspx and from there we will show him again i am using asp.net 1.1 with c# and our database is oracle 10g.
i am sending my code what i have written in my header page , header is comman to all pages so i put three hyper links and one label here is my code
its working but i am getting one problem its not changing i am getting every page as welcome and logout . can u help me out
if((Session["Username"])!=null)
{
HyperLink1.Visible = true;
HyperLink2.Visible = true;
HyperLink3.Visible=false;
Label1.Visible=false;
}
else
{
HyperLink1.Visible=false;
HyperLink2.Visible=false;
HyperLink3.Visible=true;
Label1.Visible=true;
}
if((Session["Displayname"])!=null)
{
Label1.Text="Welcome" + Session["DisplayName"].ToString()+"!";
}
else
{
Label1.Text="Welcome to rv's";
}
Session.Timeout=1;
Session.Abandon(); this is my code i put this one in my header page its comman to all pages . so write the code here. i am using asp.net 1.1 in asp.net 1.1 formsauthentication.signout is not there . can u help me out how is it possible
|
|
|
|
|
aditya.net wrote: yeah i know we have to store there names in session , what if they are 20,0000 users and when ever signup we will show him welcome name, logout . how the user control knows can u give me one sample code
Well, do you know how the session object works ? It doesn't sound like it. The Session is per user.
aditya.net wrote: HyperLink1.Visible = true;
HyperLink2.Visible = true;
HyperLink3.Visible=false;
Label1.Visible=false;
Why do so many people who post here seem scared to give their variables sensible names ?
I'd be inclined to create a struct that goes in the session, so that you either have all the info, or none of the info. Or, if it becomes too big, store an Id in the session and restore the rest from the DB.
Overall, I'm still going with 'buy a book and work through it' tho.
You didn't answer my question, is ASP.NET your first programming experience, and is someone really paying you to write this code ?
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 )
|
|
|
|
|
Hello Christian,
Before i work as a vb developer and yes this is my first ASP.NET project , Yeah this one of my priority A so i just want to know how to do i really stuck here . Mostly i work mostly on vb.net with database sql server . i never used oracle this is my first asp.net project with oracle 10 g database can u tell me how to create and help me out with sample code . so that i can understand .Thanks once again
|
|
|
|
|
Again, buy an ASP.NET book and work through it. You don't have a problem here. The session exists per user, so every one of your 20,000 users will have their own session object, and it will contain their name.
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 )
|
|
|
|
|
Again, for you to be charging someone for your ASP.NET work when you don't understand how it works, is just plain wrong. But, good for my career, it seems outsourcing will continue to be a nightmare.
When someone logs out, clear the object in the session. Then, the session state tells you if they are logged in or not. That will change what controls you show, and also can be used in a base class to stop/redirect access to pages that require login.
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 apurva thnks for u r mail its working but i am getting one problem its not changing i am getting every page as welcome and logout . can u help me out
if((Session["Username"])!=null)
{
HyperLink1.Visible = true;
HyperLink2.Visible = true;
HyperLink3.Visible=false;
Label1.Visible=false;
}
else
{
HyperLink1.Visible=false;
HyperLink2.Visible=false;
HyperLink3.Visible=true;
Label1.Visible=true;
}
if((Session["Displayname"])!=null)
{
Label1.Text="Welcome" + Session["DisplayName"].ToString()+"!";
}
else
{
Label1.Text="Welcome to rv's";
}
Session.Timeout=1;
Session.Abandon(); this is my code i put this one in my header page its comman to all pages . so write the code here. i am using asp.net 1.1 in asp.net 1.1 formsauthentication.signout is not there . can u help me out how is it possible
|
|
|
|
|
aditya.net wrote: am getting every page as welcome and logout
That is because you are using a user control for header and that control is being used in all the pages. If you don't want to display the same then you need to create different user controls for the purpose.
aditya.net wrote: Session.Abandon();
This has to be called when users clicks on logout button. Also you make the session values to null.
Apurva Kaushal
|
|
|
|
|
i am trying to recreate a physical form i have using crystal report which will display information for a specific record in my database.
can anyone send me to a good crystal report tutorial
kenny
|
|
|
|
|
Here are some
Google results[^], hope this helps you out...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hello,
I need to form string point_number + point_name and display it in my DropDownList as text.
I have a string of blanks form rezul string like this:
rez = point_number + blanks.substring(0,length(blanks) - length(point_number)) + point_name
Unfortunatly I saw that in DropDownList the string is displayed with only 1 blank between number and name : ((
Then I replace blanks to _ and everything was allright.
What I need to change in DropDownList to force it display blanks?
Thank you
|
|
|
|
|
If I am not mistaken this is because HTML removes any duplicate spaces. Try replacing spaces with & nbsp; to force them in there.
-- modified at 17:05 Thursday 12th July, 2007
Darroll
|
|
|
|
|
Ok - I'll edit it for you. He needs to put in.
|
|
|
|
|
Hello,
Thank you for answers but I tryied to replace blanks with but it displayed like this
123 Name
: ((
Here is my code:
On DropDownListDataBound
for (int i = 0; i < DDListPoint.Items.Count; i++)
{
DDListPoint.Items[i].Text = DDListPoint.Items[i].Text.Replace(" ", " ");
}
When I should replace blanks? on the client side in Javascript?
Thank you : )
|
|
|
|
|
Oops : )
second string in Replace is
|
|
|
|
|
Hello,
May be somebody knows another way to solve the problem, is there columns in DropDownList or anything else to apart data?
|
|
|
|
|
Hello,
I find solution to my problem : )
string blanks = HttpUtility.HtmlDecode("   ");
rez = point_number + blanks.substring(0,length(blanks) - length(point_number)) + point_name
|
|
|
|
|
I have a cold fusion application running on Java VM and have intentions of moving to an ASP.Net code base running on a .NET framework. The following are my reasons for making this move:
1. Less expensive server maintainace license fees
2. More support for problem resolution
3. More accessible developers as there are way more .NET developers than cold fusion.
Are these valid reasons?
Are there any more technical or otherwise reasons that i may be missing?
|
|
|
|
|
I think #1 is enough, but the decision is ultimately yours.
only two letters away from being an asset
|
|
|
|
|
I would have to say reasons #1 and #3 are the most valid ones. About 7 years ago a place I used to work for wanted to do Cold Fusion, but nothing ever really materialized with them.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Hello all
I am new in asp . I have write a pagging code in it connected with sql server database . But problem is that it show the record at multiple pages. suppose name of user one is show at page one , Its again show in page two and some of record of page three also . I can not identified its reason. My code is below.
<%
Option Explicit
Dim conn,rst,sql,Rs,uname,passwd
Dim intTotalpages,intCurrentpage,intI,strQ,j, varSearch,objConec
Const intPagesize=10
intI=1
If Request("currentPage")="" Then intCurrentpage=1 Else intCurrentpage=Request("currentPage")
if request("currentPage")="0" Then intCurrentpage=1
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=MSDASQL;" & _
"DSN=subscribedsn;DATABASE=subscribe;UID=xyz;PWD=xyz;"
Set conn = Server.CreateObject("ADODB.Connection")
With conn
' Set .ActiveConnection=objConec
.cursorLocation=3
' .cachesize=intPagesize
' Set conn =objConec.Execute (StrQ)
End With
conn.open "PROVIDER=MSDASQL;" & _
"DSN=subscribedsn;DATABASE=subscribe;UID=xyz;PWD=xyz;"
sql = "select * from table "
'response.Write(sql)
'response.End()
Set rst = Server.CreateObject("Adodb.Recordset")
rst.Open sql, conn, 3, 3
If Not rst.Eof Then
rst.pageSize=intPageSize
If Not isNumeric(intCurrentpage) Then intCurrentpage=1
If (CInt(intCurrentpage) > rst.PageCount) Then intCurrentpage=1
rst.absolutePage=intCurrentpage
intTotalpages=rst.pageCount
End If
%>
<title>XYZ
| | | |
| |
<% If rst.EOF or rst.BOF then %>
<%
Else
do while not rst.EOF %>
<% rst.movenext
loop
rst.movefirst
End If
%>
List Of Subscribe Members | User Name | E Mail | Project | Country | Dated | Status | Delete | No Registration posted !( Database Empty ) | <%=rst("nam")%> | <%=rst("email")%> | <%=rst("prj_type")%> | <%=rst("country")%> | <%=rst("date_field")%> | <%=rst("status")%> | "> |
| <%if not rst.BOF or not rst.EOF then%>
Page -»
<%
for j=1 to intTotalpages
if j=int(intCurrentPage) then
%>
?currentPage=<%=j%>"><%=j%>
<%else%>
?currentPage=<%=j%>"><%=j%>
<%
end if
next
end if
rst.close : conn.close
set rst=nothing : set objConec=nothing
%> | | |
Regard's
Kaushik
|
|
|
|
|
Y_Kaushik wrote: sql = "select * from table "
Try with ORDER BY clause. You can use TOP expression too.
SELECT * FROM table ORDER BY <field1>
SELECT TOP 5 * FROM table ORDER BY <field1>
SELECT TOP 5 PERCENT * FROM table
SELECT TOP 5 PERCENT WITH TIES * FROM table ORDER BY <field1>
PERCENT
Indicates that the query returns only the first expression percent of rows from the result set.
WITH TIES
Specifies that additional rows be returned from the base result set with the same value in the ORDER BY columns appearing as the last of the TOP n (PERCENT) rows. TOP ...WITH TIES can be specified only in SELECT statements, and only if an ORDER BY clause is specified.
All the above are different way of getting the data in an ordered manner.
|
|
|
|
|
Sir
In this case my table contain only 41 record it show 41 record on page 1 and show total page 5 on page 2,3 and 4,5 its show the repetation of records.
My problem is that how set the limit of record on page show that page can not be displayed on page 2 and so on
Regard's
Kaushik
|
|
|
|
|
hi when i allow sorting on gridview i recieve this error message
The GridView 'GridView1' fired event Sorting which wasn't handled.
i also add this event in gridview and add this code
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
GridView1.Sort(e.SortExpression, e.SortDirection);
}but infinite loop occurs and page give error
Please tell me solution of this problem
Thanx
|
|
|
|