|
The obvious question that "leaps out at me" on this thread, when you disclose there's some discrepancy between two files that came from a "contract shop:"
Why aren't you able to get the correct code from the contract shop, or get them to resolve this ?
Something happened that prevents you from getting any support from them ?
best, Bill
The glyphs you are reading now: are place-holders signifying the total absence of a signature.
|
|
|
|
|
I did some digging, and it's a an old download from the asp.net website, probably back from 2004 that implements masterpages, before maserpages was included in the framework. The original implementation is a cs file for the App_Code, and he's looking for the DLL file associated for it, for comparison.
I think the app is almost 10 years old, and they don't realize that the app needs a major upgrade.
|
|
|
|
|
hi all
i want to create a website that has ability to create another website like free blogs that every one has a page with own management. so can you tell me how can i do that with asp and vb .
|
|
|
|
|
|
Hi Everyone,
Good evening. Can you help me point out what seems to be the problem with my applciation? I know my problem will be a piece of cake to you guys.
I have a login page where the user will input his username and password:
here is the code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Try
status = Request.QueryString("status").ToString()
If status = "NOTADMIN" Then
lblWarning.Text = "Sorry you are not allowed to access the site. Please contact Site Admin."
End If
Catch ex As Exception
Dim a As String = ""
End Try
End If
End Sub
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
If TbUsername.Text <> "" OrElse TbPassword.Text <> "" Then
Session.Timeout = 480
Dim accessData As New DataAccess()
Dim User As String = TbUsername.Text
Dim Username As String() = User.Replace("\", "|").Split("|"c)
Session("Username") = Nothing
Dim Authentication As Boolean = IsUserAuthenticated("LDAP://" & Username(0).ToString(), Username(0).ToString(), Username(1).ToString(), TbPassword.Text.Trim())
If Authentication = True Then
StaticObject.UserName = ""
StaticObject.Password = ""
StaticObject.Domain = ""
StaticObject.Domain = Username(1).ToString()
Session("UserName") = Username(1).ToString()
StaticObject.Domain = Username(0).ToString()
accessData.AddUser(Username(1).ToString())
Dim Authorization As String = accessData.CheckUserAccess(Username(1).ToString())
Dim MyAuthorization As String() = Authorization.Split("|"c)
StaticObject.UserLevel = MyAuthorization(0).ToString()
StaticObject.IsAdmin = MyAuthorization(1).ToString()
If MyAuthorization(0).ToString() <> "9" Then
Session("displayName") = StaticObject.DisplayName
Response.Redirect("Home.aspx")
Else
lblWarning.Text = "Sorry you are not allowed to access this Site, please contact the Site Administrator"
End If
Else
lblWarning.Text = "User Name or Password incorrect! Note: 3 consecutives incorrect login your account will be locked!"
End If
End If
End Sub
Public Function IsUserAuthenticated(ByVal strAdPath As String, ByVal strDomain As String, ByVal strUserName As String, ByVal strPassword As String) As Boolean
Dim directoryEntry As New DirectoryEntry(strAdPath, strUserName, strPassword)
Dim directorySearcher As New DirectorySearcher(directoryEntry)
Dim Authentication As [Boolean]
Try
Dim searchResult As SearchResult = directorySearcher.FindOne()
Authentication = True
directorySearcher.Filter = "(&(objectClass=person) (samaccountname=" & strUserName & "))"
Dim result As SearchResult = directorySearcher.FindOne()
Dim resultEntry As New DirectoryEntry()
resultEntry = result.GetDirectoryEntry()
StaticObject.DisplayName = resultEntry.Properties("displayName").Value.ToString()
Catch ex As Exception
Authentication = False
TbUsername.Text = ""
TbPassword.Text = ""
End Try
Return Authentication
End Function
End Class
so basically it is using windows login.
The poblem is that :
The page does not recognize that there is already a session. Therefore, still showin the login button when it should be logout because the user was able to login.
Here is the code:
Private user As StaticObject = Nothing
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("displayName") Is Nothing Then
lblUserFullName.Text = "null"
Else
If Not Page.IsPostBack Then
Try
lblUserFullName.Text = StaticObject.DisplayName
Catch ex As Exception
End Try
End If
End If
End Sub
Protected Sub loginstatus_LoggedOut(ByVal sender As Object, ByVal e As System.EventArgs) Handles loginstatus.LoggedOut
Session.Abandon()
Session.Clear()
End Sub
Protected Sub loginstatus_LoggingOut(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles loginstatus.LoggingOut
End Sub
thank you very much in advance and I made sure I did my best to fix this before seeking for help.
|
|
|
|
|
It cleared the session when the login button was clicked
Session("Username") = Nothing
And set the value back when the user was authenticated.
It's just using 1 session variable, and seems to update a database table upon login
I would not detect if a user is logged in, and give them access, unless it's security is not a concern
But if you want to, you can just modify the code to detect the session user, and authenticate them again. Strange, I don't see a password, must be the string array userName(1) and userName(0)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Try
If Not Session("user") is nothing then
Dim userName As String = Session("user")
StaticObject.Domain = username.ToString()
Session("UserName") = username.ToString()
StaticObject.Domain = username.ToString()
accessData.AddUser(username.ToString())
Dim Authorization As String = accessData.CheckUserAccess(Username(1).ToString())
Dim MyAuthorization As String() = Authorization.Split("|"c)
StaticObject.UserLevel = MyAuthorization(0).ToString()
StaticObject.IsAdmin = MyAuthorization(1).ToString()
If MyAuthorization(0).ToString() <> "9" Then
Session("displayName") = StaticObject.DisplayName
Response.Redirect("Home.aspx")
else
status = Request.QueryString("status").ToString()
If status = "NOTADMIN" Then
lblWarning.Text = "Sorry you are not allowed to access the site. Please contact Site Admin."
End If
End If
Catch ex As Exception
Dim a As String = ""
End Try
End If
End Sub
|
|
|
|
|
Hi,
Can anybody please advice me if I can apply xml or xsl transformations on xsl-fo. I have an xsl-fo file which I have to transform in to html some how.
Can I apply the xml and xsl transformations that are available in .Net on xml and xsl-fo so that I can apply it and convert it in to html using just .Net libraries that are provided by .Net framework. Not any external third party tools.
Any support like a code snippet or any link would be a great help. i have been googling still not finding it. I will still google but if anybody knows please help me.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 3-Jul-12 14:00pm.
|
|
|
|
|
You may have better luck in the XML / XSL forum.
|
|
|
|
|
Hi,
Actually I am looking for xsl fo transformations, is it possible using .Net without using any 3rd party libraries.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hi All,
I have user registration form which is created dynamically depending upon id comming from previous page.
I have to store this id somewhere and want to retrive it in oninit method while postback.
I dont want to use Session or static veriable to store this id, so where should i stored it.
can any one help me out.
thanks in advance.
|
|
|
|
|
Database?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Just make a global textbox and hide it
CSS Display: none;
You make the textbox in onInit, and load the ID in OnLoad
|
|
|
|
|
I have a Counter on a textbox done in Javascript like twitter that counts the text entered. Now It works fine. The Textboxes get field with data and after that i want to calculate the renmaining Text. i have a code for that after i bind the textbox. So i have this
ScriptManager.RegisterStartupScript(Page, GetType(String), "FF", "InitializeCounter(" + "ctl00_ContentPlaceHolder_Main_Wizard1_Servitudes" + ",'ndacount2','bar','800');", True)
ScriptManager.RegisterStartupScript(Page, GetType(String), "FF", "InitializeCounter(" + "ctl00_ContentPlaceHolder_Main_Wizard1_Introduction" + ",'NDAcount1','bar','800');", True)
and i realized that it only calculate the textbox counts for only the First one and fail to do it for the second one. Maybe it does not like multiple RegisterStartupScript
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
This is because your 'stringKey ' is same for both the startupscripts. Multiple RegisterStartUpscripts are allowed.
Try:
ScriptManager.RegisterStartupScript(Page, GetType(String), "FF", "InitializeCounter(" + "ctl00_ContentPlaceHolder_Main_Wizard1_Servitudes" + ",'ndacount2','bar','800');", True)
ScriptManager.RegisterStartupScript(Page, GetType(String), "FF2", "InitializeCounter(" + "ctl00_ContentPlaceHolder_Main_Wizard1_Introduction" + ",'NDAcount1','bar','800');", True)
Now, two strings - FF, FF2
|
|
|
|
|
Thanks that worked
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
|
I'm calling Classic ASP page from ASP.net Page through Response.Redirect its not working . I'm working on VS2008 environment.
How to call Classic ASP page from ASP.net Page ?
|
|
|
|
|
Try calling classic ASP via a WebClient.
WebClient client = new WebClient ();
Stream data = client.OpenRead ("http://server/foo.asp?bar=baz");
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();
data.Close ();
reader.Close ();
Details here: Calling Classic ASP from C# ASP.Net[^]
|
|
|
|
|
The remote server returned an error: (403) Forbidden.
Above is the error i'm getting ?
|
|
|
|
|
Response.Redirect will work fine, to any kind of page. What is the problem you are having?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
It should work. @OP, did you debug your code?
If you've never failed... You've never lived...
|
|
|
|
|
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /testing/demo.asp
*******************
Above is the error i 'm getting on my development machine using VS2008
******On IIS 7 also i'm getting error
|
|
|
|
|
The error is telling you that asp files are blocked. It has nothing to do with your code but is an IIS setting. I am not sure where so you may want to google the error.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I want to decompile a C# 2010 web form application. I am not certain what files I would use to decompile and where those files are located at. When I create a deployment project using the setup and deployment method that visual studio will not be using starting in visual studio 2012, I am looking in the bin directory. I would think there would be an exe that i could decompile.
However there several dll files.
Thus to decompile a C# 2010 web form application would i find an exe and/or would I need to use all the dll files? If I use all the DLL files, how would I combine them together so I can decompile?
|
|
|
|
|
JetBrains dotPeek 1.0[^] is what I've been using. Seems as good as any of the others.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|