|
I'm pretty sure that's a setting you should be setting on the folder containing the XML file on the web server. Alternatively, you can embed the XML file in your application's DLL, which will make it inaccessible to the client side. Or you could store it in a database.
|
|
|
|
|
I have xml in root folder. I just want to stop viewing xml file from outside.
|
|
|
|
|
Hi All,
I developed a login page and added a link button(for logout) in all other pages. The code that I used behind logout is just Response.Redirect("Login.aspx")
So, when I click logout, it redirects me to the Login page but when I click back button in the browser, it goes into the application without the need of login.
Can anyone please help me how to do a safe logout in a web appliction so that even when I click back button it should not be entered into the application again without a proper login?
i've neither used a session variable nor FormsAuthentication. If I have to use session variables, please explain me how to use them(as I'm new to .NET). The code that I used in the login page is below:
Imports System.Data.SqlClient<br />
<br />
Partial Class Login<br />
Inherits System.Web.UI.Page<br />
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate<br />
Dim authentication As Boolean = False<br />
authentication = Sitelevelauthentication(Login1.UserName, Login1.Password)<br />
e.Authenticated = authentication<br />
If authentication = True Then<br />
Response.Redirect("Default.aspx")<br />
End If<br />
<br />
End Sub<br />
Private Function Sitelevelauthentication(ByVal Username As String, ByVal Password As String) As Boolean<br />
Dim boolretval As Boolean<br />
Dim con As New SqlConnection<br />
Dim Dr As SqlDataReader<br />
Dim sql As String<br />
con.ConnectionString = "Data Source=;Initial Catalog=;User ID=;Password="<br />
sql = "SELECT * FROM Login"<br />
con.Open()<br />
Dim cmd As New SqlCommand(sql, con)<br />
Dr = cmd.ExecuteReader()<br />
While Dr.Read()<br />
If Username = Dr("Username").ToString And Password = Dr("Password") Then<br />
boolretval = True<br />
End If<br />
Dr.Close()<br />
Return boolretval<br />
<br />
End While<br />
End Function<br />
End Class
Thank you,
Ranjani.
|
|
|
|
|
|
|
Hi All,
I have .cmd file which has an environment variable steps. This .cmd file is giving wrong results. When I edit and saw the .cmd file its setting the steps evn variable twice. Is it because of this the wrong results are coming.
Whats the meaning of setting the env variables twice, does it give different meaning than setting it for only once. And whats the impact of setting the environment variables twice.
set steps=%steps% "_07.5.2 QUTransUnionSimulator"
set steps=%steps% "_07.5.1 RunScoreBureauSimulator"
set steps=%steps% "_07.5.2 QUTransUnionSimulator"
set steps=%steps% "_07.5.1 RunScoreBureauSimulator"
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I doubt you'll get an answer in the Asp.Net forum for a .cmd question. Try posting in the right place: perhaps the System Admin forum.
"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
|
|
|
|
|
Ok. Sure. Thanks.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
My page currently displays the five most recent feeds off a site. However I would like to try and filter the feeds based on keywords that are in the description field. My code right now for downloading the feed and binding it to a repeater is:
Dim rssHUDPressDoc As XDocument = XDocument.Load("http://www.hud.gov/news/hudrss.xml")
Dim pressPosts = From item In rssHUDPressDoc.Descendants("item") _
Take 5 _
Select Title = item.Element("title").Value, _
link = item.Element("link").Value, _
description = item.Element("description").Value, _
pubDate = item.Element("pubDate").Value
If pressPosts.Count = 0 Then
lblNoPress.Visible = True
Else
rssHUDPress.DataSource = pressPosts
rssHUDPress.DataBind()
End If
The above code returns the feeds just fine and I'm able to display it with no problem. However I'm trying to do something to the effect that if I have a string array of keywords:
Dim keywords() as string = new string(){"keyword1","keyword2","keyword3"}
I can change the LINQ statement to something like this:
Dim pressPosts = From item In rssHUDPressDoc.Descendants("item") _
Take 5 _
Where item.Element("description").Value.ToString.Contains(keywords)
Select Title = item.Element("title").Value, _
link = item.Element("link").Value, _
description = item.Element("description").Value, _
pubDate = item.Element("pubDate").Value
However the .Contains() method only accepts a single string, not an array. Currently I need to filter by multiple keywords that apply to our industry and I'm trying to avoid writing numerous OrElse statements within the Where clause. Any suggestions on how I can do this?
Thanks in advance for any help. Been working on this problem for two days now and I can't think of what else to try.
|
|
|
|
|
I have a normal ASP web app that navigates to a different content page when a menu clicked. As usual, this type of navigation is a normal function of menu control. My question is how do I call back to an EXE or VBScript file from a menu-item? Thanks.
Best,
Jun
modified on Friday, May 27, 2011 9:55 AM
|
|
|
|
|
See Here[^], it should help.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hi, I'm using ASP.NET administrative tool to configure security. I want to authenticate page-by-page not directory by directory
On the left side in (MANAGE ACCESS RULES), it only shows directories, not pages. How to select particular page and then authenticate in WAT. If not, then what is the alternative.
Regards
Asif Rehman
|
|
|
|
|
The one that I know of you can do it from web.config file. So in your web.config you need to use the location tag to exclude the pages that you do not want to authenticate..
Look at this example:
<configuration>
<location path="YourPath/yourfile.aspx">
<system.web>
<authorization>
<deny users="?" /> - OR - <allow users="?" />
</authorization>
</system.web>
</location>
</configuration>
|
|
|
|
|
I am maintaining an old vb.net app that is currently compiling and running in .net 1.1
the problem is we want to upgrade it to operate in 2.0 while still being able to compile and run in 1.1 as some clients will not want to upgrade. We would like to avoid having a separate code line for each version.
I am running into a problem with a modal page being popped up - on return to the main page this error is thrown when running 2.0:
"Exception : System.ArgumentException : Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation."
The 2 solutions they recommend are not available in 1.1. I have tried to import different @Page directives based on the version of dotnet to no avail.
Any advice is appreciated.
|
|
|
|
|
Make sure you place the enableeventvalidation to the right place in web.config. It should be inside system.web. For reference:
<configuration>
<appSettings>
</appSettings>
<system.web>
<pages validateRequest="false" enableEventValidation="false"/>
<customErrors mode="Off"/>
<compilation debug="true">
</compilation>
</system.web>
</configuration>
OR
1.1 event validation consisted of checking for "<"'s in the postback
data. You should use the page directive to turn it off.( i know you have already tried that)
Also check this link that might be helpful as well; Enable event validation[^]
|
|
|
|
|
is it possibled that a user should not be able to resize a perticular page in a web site? if yes then how...
just thinking if i can skipp writing 'onresize' event
Thanks
|
|
|
|
|
The resizing is controlled by the browser and there is no way to prevent a user from resizing the window, unless you are opening another window, such as a popup, and that can be blocked by settings so it is not a good practice.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
yaa i think so...
thanks mark...
|
|
|
|
|
Hello,
I have my asp/vb order form and it has a total that I want to pass dynamically to the Buy Now button.
Say my total$ is in TextBox1.text and I want to pass it to:
********************* so I want the value="10.00" to be the value of my textbox1.text
How do I do this?
Thanks in advance,
Dave
|
|
|
|
|
|
right answer
also 'amount' should be the 'id' of hidden type input not name.
|
|
|
|
|
The control doesnt work, i dont know why, i cant login, even when i retrieve the password.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http:
-->
<configuration>
<system.net>
<mailSettings>
<smtp from="makovetskiyd@yahoo.co.uk">
<network host="smtp.gmail.com" enableSsl="true" defaultCredentials="false" port="587" userName="yourguru27@gmail.com" password="luckyd55"/>
</smtp>
</mailSettings>
</system.net>
<connectionStrings>
<add name="YourGuruDB" connectionString="Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True"/>
<add name="modelConnectionString" connectionString="Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="LocalSqlServer2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename='D:\Documents and Settings\Dima\My Documents\Visual Studio 2010\WebSites\WebSite10\App_Data\ASPNETDB.MDF';Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<membership defaultProvider="MyMembershipProvider">
<providers>
<clear/>
<add
name="MyMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
minRequiredPasswordLength="2"
minRequiredNonalphanumericCharacters="0"
maxInvalidPasswordAttempts="1000"
passwordAttemptWindow="1000"
applicationName="/WebSite10"
/>
</providers>
</membership>
<roleManager enabled="true" />
<authentication mode="Forms">
<forms name="MyAppCookie"
loginUrl="~/Registration.aspx"
protection="All"
timeout="43200"
requireSSL="false"
slidingExpiration="true"
cookieless="UseCookies"
enableCrossAppRedirects="false"
path="/" />
</authentication>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
</system.web>
</configuration>
The above is web.config. i have no idea what to correct. Some said that i need to pass the connection string to the membership provider config. I tried it and it made no
difference. Yesterday, it worked, but today it stopped working, no idea why .
Other things that i checked:
I havent locked myself out...
|
|
|
|
|
connectionStringName="LocalSqlServer"
This will refer to the entry in the machine.config file for the system it is running on since you did not define it in the current web.config file. Check there.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I tried to connect with a new password and couldnt, it doesnt let me in!!
I used CCleaner to clean everything today,,may be it deleted my cookie, but isnt a new cookie being allocated. whats the problem!!?
|
|
|
|
|
It is not a cookie issue. What even makes you think it is?
If the MembershipProvider is not using the correct database it doesn't matter how many times you change your password it still won't work.
I know the language. I've read a book. - _Madmatt
|
|
|
|