|
Is this code safe for password encryption in asp.net web forms?
string pass = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text, "md5");
Is there any differentiation between above code and below code?
UTF8Encoding encoder = new UTF8Encoding();
MD5 md5 = new MD5CryptoServiceProvider();
byte[] hashedPassword = md5.ComputeHash(encoder.GetBytes(TextBox1.Text));
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashedPassword.Length; i++)
{
sb.Append(System.Convert.ToString(hashedPassword[i], 16).ToString());
}
string pass = sb.ToString();
Best Regards...
|
|
|
|
|
I bought a new computer ( with Windows XP Prof ) and I reinstalled Visual Studio 2005 ( Team edition for Software Developers ). However this time I also installed Visual Studio 2005 Service Pack 1 ( since it is claimed that they removed a lot of previous bugs through it) before installing AJAX 1.0.
The problem is that the “LoginView” control does not show up in the web page anymore.
What happened ? Did the “LoginView” control change with the addition of Service Pack 1 ?
If so, what parameters should I change to make it functional again ?
Here my LoginView code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<span class="UserInfoSignIn">You are not logged in.</span>
<!--<asp:Label ID="SignInWarning" CssClass="UserInfoSignIn" runat="server" Text="You are not logged in."></asp:Label>-->
<asp:LoginStatus LoginImageUrl="~/Images/signin.gif" CssClass="login_status" Width="60" Height="20" ID="LoginStatus1" runat="server" />
<a href="Register.aspx">
<img src="Images/register.gif" width="66" height="20" border="0" style="position:absolute; left:35px; top:198px; z-index:3;"/>
</a>
</AnonymousTemplate>
<RoleGroups>
<asp:RoleGroup Roles="Customers">
<ContentTemplate>
<asp:Label ID="UserWarnLb" CssClass="UserInfoText" runat="server" Text="You are logged in as : "></asp:Label>
<asp:LoginName ID="LoginName1" runat="server" FormatString="<b>{0}</b>" CssClass="UserNameText" />
<asp:LoginStatus ID="CustomerStatus" OnLoggedOut="CustomerStatus_LoggedOut" LogoutImageUrl="~/Images/signout.gif" CssClass="login_status" Width="60" Height="20" runat="server" />
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="SI_administrator">
<ContentTemplate>
<a class="UserDetLink" href="UserDetailsAdmin.aspx">User Details Administration</a>
<a class="UserInfoLink" href="DatabaseAdmin.aspx">Database Administration</a>
<a class="ShopInfoLink" href="ShoppingCartAdmin.aspx">Shopping Cart Adm</a>
<a class="OrdersInfoLink" href="OrdersAdmin.aspx">Orders Adm</a>
<a class="CartoonArticleInfoLink" href="CartoonAdmin.aspx">Cartoons-Articles Adm</a>
<asp:Label ID="UserWarnLb2" CssClass="UserInfoText2" runat="server" Text="You are logged in as "></asp:Label>
<asp:LoginName ID="LoginName2" runat="server" FormatString="<b>{0}</b>" CssClass="UserNameText2" />
<asp:LoginStatus ID="AdministratorStatus" OnLoggedOut="CustomerStatus_LoggedOut" LogoutImageUrl="~/Images/signout.gif" CssClass="login_status" Width="60" Height="20" runat="server" />
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
I have a custom asp.net calender control that does everything on the client through javascript, and when the user clicks save, the control serializes its state into a hidden field which is then parsed on the server and saved into a database.
The problem i have is how to know when the page is posting back, so the control can save its state in the hidden field. When i add a event handler through Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(MySaveMethod); the changes to the hidden field do not show up on the server, but if i first save the state through a custom click event (onclick="MySaveMethod") and then submit the page i do see the saved state.
It seems that when using the PageRequestManager the controls are already disposed or the postback is already in action and any changes i make is lost.
I want to be able to intercept a postback request, save the control state in the hidden field and retrieve it on the server.
Thanks in advanced
|
|
|
|
|
Hi,
How to create an asp.net application that enables to drag and drop items like a rectangle ,circle etc. shaped elements created using VML(Vector Markup Language) tags in the webform.
cheers,
chakri.
chakravarthy
|
|
|
|
|
what do you mean by "drag & drop" ?
there are plenty of examples of Javascript and DHTML for this
only two letters away from being an asset
|
|
|
|
|
<asp:sqldatasource id="dsBorrowers" runat="server"
="" selectcommand="SELECT * FROM [BORROWERS]" connectionstring="<%$ ConnectionStrings:OxfordLibrary %>">
From this code I can bind data on Page_Load event
I want to bind data on Button_Click event using a SqlDataSource
Thanks in Advance
Sarfarj Ahmed
|
|
|
|
|
Maybe I'm missing something, but just copy the code from Page_Load to the click event handler.
|
|
|
|
|
In my application i need to keep "tip of the day".i have a table with a list of tips. I need to display one of the tips from database table on to the web page and it has to change every day(increment).But Same tip is coming if i'm using "Application"
Please help to solve this problem.
|
|
|
|
|
Well it's quite obvious that you also need to store the index of the last row accessed. if it is global to your application, then You can use an application level variable, otherwise use a cookie for each user.
int x = (int)Application["tip_num"];
DataRow tip = ((Datatable)Application["tips"]).Rows[x];
only two letters away from being an asset
|
|
|
|
|
Can we assign .aspx page (contains only image) to an Image URL which is in another page?
Can it work after deployment?
Regards,
Jai Shankar
|
|
|
|
|
jaishankar2704 wrote: Can we assign .aspx page (contains only image) to an Image URL which is in another page?
Yes, if your ASPX page is configured to return a binary stream representing the image instead of HTML text.
jaishankar2704 wrote: Can it work after deployment?
Yes, if you deploy it correctly.
Paul Marfleet
|
|
|
|
|
function trim(s)
{
return rtrim(ltrim(s));
}
function ltrim(s)
{
var l=0;
while(l < s.length && s[l] == ' ')
{
l++;
}
return s = s.substring(l, s.length);
}
function rtrim(s)
{
var r=s.length -1;
while(r > 0 && s[r] == ' ')
{ r-=1; }
return s.substring(0, r+1);
}
what's the meaning of return s = s.substring(l, s.length);
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote
what's the meaning of return s = s.substring(l, s.length);
It takes s.length chars from the string s starting at position l and stores it in a variable called s and return s it to the calling function.
I learnt that from a book.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
http://www.codeproject.com/script/comments/forums.asp?msg=2295421&forumid=1645#xx2295421xx
Have you seen how greately u're being regarded in the Suggestions Forum
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Hi,
I want to get the client hostname or ip address using asp.net.
I have tried the following methods...
Request.UserHostName - returns proxy ip address
Request.UserHostAddress - returns proxy ip address
Request.ServerVariables["REMOTE_ADDR"] - returns proxy ip address
Request.ServerVariables["HTTP_X_FORWARDED_FOR"] - returns empty.
I could not get the actual ip address of the client machine.
Can any one help...how to get the actual client ip address?
Thanks in advance.
Ram
|
|
|
|
|
Try this:
string hostName= System.Net.Dns.GetHostName()
string ipAddress = System.Net.Dns.GetHostAddresses(hostName)(0).ToString()
Felipe
|
|
|
|
|
Hi All, I tried to open a new IE window from C# code and it works for any sample website. However, the same code doesnt work for ajax enabled website. I have removed ajax by deleting
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
from .aspx but still it doesnt work, any clues ??? Do i need to remove something more than that ?
Here is my code for opening the new window that works on pages other than my website page:
string strQS = "http://www.yahoo.com";
StringBuilder strScript = new StringBuilder();
strScript.Append("<script language=JavaScript>");
strScript.Append("window.open('" + strQS + "', \"\",\"height=100,width=400,left=0,top=0,toolbar=no,menubar=no\");");
strScript.Append("</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "subscribescript", strScript.ToString());
I would appreciate your help. Thanks
Knowledge is knowing a tomato is a fruit. Wisdom is not putting it in a fruit salad.
|
|
|
|
|
First, you can't open a new windOw using C#. you are using C# to inject Javascript that Will open a new window.
where are you calling this code? Are you trying to hare this script called when the page is rendered on the client?
only two letters away from being an asset
|
|
|
|
|
This code is called on my grid view event , I want to open a new window on grid event. But on this page where this code is not working, it is not working for any control , be it simple button click , and on other pages, it is working on same events, I wonder whats so special in this page , I thought it must be ajax creating problem but now i have removed its reference from the page with same result happening.
|
|
|
|
|
using a script library would be a better approach.
are you sure the grid event is being called? check the function name. Is it a typo?
only two letters away from being an asset
|
|
|
|
|
on first aspx form i have gridview where i must select one row and show that row on the other aspx form . Thanx
|
|
|
|
|
|
I use this VB.NET code in my webproject to export a datatable to an Excel file. The characters é,ä, ... are shown in the Access database, I fill the datatable with the content of a table from the database and export it to Excel. In Excel é, ä, ... are replaced with strange characters... Does anyone know why this happens?
Inherits System.Web.UI.Page
Dim oConn As clsRoot
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oLog As New clsLog(clsLog.LogLevel.Warning, Server.MapPath("log/contacten.log"))
oConn = New clsRoot(Server.MapPath("link/contacten.udl"), oLog)
oConn.Open()
Dim dt As DataTable = oConn.getContacten()
Response.ContentType = "application/ms-excel"
Response.AddHeader("Content-Disposition", "inline;filename=contacten.xls")
Response.Write(ConvertDtToTDF(dt))
End Sub
'Converts a DataTable to Tab Delimited Format
Private Function ConvertDtToTDF(ByVal dt As DataTable) As String
Dim dr As DataRow, ary() As Object, i As Integer
Dim iCol As Integer
'Output Column Headers
For iCol = 0 To dt.Columns.Count - 1
Response.Write(dt.Columns(iCol).ToString & vbTab)
Next
Response.Write(vbCrLf)
'Output Data
For Each dr In dt.Rows
ary = dr.ItemArray
For i = 0 To UBound(ary)
Response.Write(ary(i).ToString & vbTab)
Next
Response.Write(vbCrLf)
Next
End Function
|
|
|
|
|
hai all,
In my project,I have developed an application using ajax anabled website..
When i place the Gridview Control inside update panel.. Paging is not
working..i.e ..in first page alone it is displaying the paging..when i go to
some other page(like 2 nd or 3 rd page).. the paging is not working..its
visibility becomes false...the script manager property is placed in the
master page.. how can i overcome this issue???? please help... thanks in
advance....
with Regards,
Imthiyas Ahamed.A
|
|
|
|
|
Have you set UpdateMode="conditional" to the update panel
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|