|
First of all passing password on your URL is bad, what ever way you do it.
If you wish to not use session/cookies/server.transfer then you are left with only querystring or the request.form objects.
As far as I know you cannot hide data from querystring, you can encrypt/decrypt it though, but you don't want to do it.
So, you have to go the classic ASP way and POST the data to the new page and get the data using request.form.
HTH!
|
|
|
|
|
sandympatil wrote: Actually i dont want to use Session, Cookies, Context, Server.Transfer and any other state management technique. I just want to use Querystring
You dont want ot use any other any other state management technique and just want ot use querystring.
AFAIK,There is no way to hide querystring parameter else you have to use another way.Better you can encrypt/decrypt if you have to stick with querystring.
Generally it is not recommendsed to use querystring for sensitive data like yours.
|
|
|
|
|
sandympatil wrote: just want to use Querystring and want to hide it
OOkay , here is what the "login"
page looks like...
</head>
<body>
<form action=''>
enter password<br>
<input type="password" name="password" >
<input type="submit" >
</form>
</body>
<script type="text/javascript">
xhr = new XMLHttpRequest();
myredirect = function () {
xhr.open("GET", "http://whoever.com/Default3.aspx?" + document.forms[0].password.value, true);
xhr.onreadystatechange = function () {
if (this.readyState == 4) {
if (this.responseText == "failed") { alert("failed"); }
else {
window.location.replace(this.responseText);
}
}
}
xhr.send(null);
return false;
}
document.forms[0].onsubmit = myredirect;
</script>
</html>
hereis the aspx file ...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
here is the aspx.cs ...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString.ToString() == "password")
{
Response.Write("http://www.msn.com");
Response.End();
}
else
{
Response.Write("failed");
Response.End();
}
}
}
|
|
|
|
|
Thanks for Reply.......... 
|
|
|
|
|
As always, you are more than welcome.
Thank you for the "vote up".
|
|
|
|
|
|
Once I had the same problem, but it was a special case, I used to send the user name and password from server to client PC and then from client PC using JavaScript to another server using post method, I know it is not a secure solution, but temporary you can use this technique.
Thanks
Khalid, Afghanistan
|
|
|
|
|
Hi.
I have this UpdatePanel with som boundfield content. In this panel (on every row), there is an edit link, which will edit the content. It works fine.
Now I want to make all the boundfields clickable as a link, so they act as the edit button for each row content. In that way, I dont have to click the edit button, but can click anywhere in the corresponding row to edit the content. (if only it is possible to make the content-text clickable, I guess thats ok too).
My code:
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="gvTasks" runat="server" OnRowCreated="gvTasks_RowCreated"
DataSourceID="odsTaskList" GridLines="None" AutoGenerateColumns="false"
CssClass="mGrid" PagerStyle-CssClass="pgr"AlternatingRowStyle-CssClass="alt"
OnSelectedIndexChanged="GvTasks_SelectedIndexChanged" DataKeyNames="ID">
<Columns>
<asp:BoundField DataField="Content" HeaderText="Content">
<HeaderStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="Enddate" HeaderText="Enddate">
<HeaderStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="btnViewDetails" runat="server" Text="Edit" CommandName="Select" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="removeButton" runat="server" CommandArgument='<%# Eval( "id" ) >' OnCommand="removeButton_Click" ImageUrl="~/img/remove.gif" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate&>
</asp:UpdatePanel>
Hope you can help!
Thanks alot
// Sorry for the formatting, seems like code-project has a problem at the moment?!
|
|
|
|
|
 hi,
Use the code below,
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="gvTasks" runat="server" OnRowCreated="gvTasks_RowCreated" DataSourceID="odsTaskList"
GridLines="None" AutoGenerateColumns="false" CssClass="mGrid" PagerStyle-CssClass="pgr"
AlternatingRowStyle-CssClass="alt" OnSelectedIndexChanged="GvTasks_SelectedIndexChanged"
DataKeyNames="ID">
<Columns>
<asp:TemplateField HeaderText="Content">
<ItemTemplate>
<asp:LinkButton ID="btnContent" runat="server" CommandName="Select" ><%# Eval("Content")%></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Enddate">
<ItemTemplate>
<asp:LinkButton ID="btnEnddate" runat="server" CommandName="Select" ><%# Eval("Enddate")%></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="removeButton" runat="server" CommandArgument='<%# Eval( "id" ) %>'
OnCommand="removeButton_Click" ImageUrl="~/img/remove.gif" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
Hope this will help.
|
|
|
|
|
Of course!
Thanks alot man! 
|
|
|
|
|
Hi guys, does anyone know how you can insert data from an excel file into
tables in sql sever(2005)
I tried the below and gives me an error:
SELECT *
INTO [member_details]
FROM OPENROWSET('MSDASQL',
'Driver={Microsoft Excel Driver (*.xlsx)};DBQ=c:\memebers.xlsx',
'SELECT * FROM [Wanderes$]')
and the error: The OLE DB provider "MSDASQL" for linked server "(null)" reported an error. The provider did not give any information about the error.
Am doing all this in Sql Server
Please help
Thanks, Morg
|
|
|
|
|
|
Respected Sir,
On IE My web site run with alignment.But on Chrome it not run
with good manner and alignment will be change.
please help me
Thanks And regards
lalit
|
|
|
|
|
how are you doing the alignment? what language? javascript, CSS or from the style tags in the control.
If you could show a sample of the code where its going wrong and how we might be able to help you furhter
|
|
|
|
|
Hai all
I need to open save dialog box on ultrawebgrid cell click , i hv used the code "document.execCommand("saveAs")"
dialog box is opening , but i need to save .doc file also, in the filetype it shows only Html and .txt file. Plz help me .
Thank you
|
|
|
|
|
|
hai all,
i have a sqlstatemnt which returns 10 rows.
I am fillig this data in gridview using datareader.Nothing new.
But i wanted to fill the data on some condition,so that the rows which are fulfilling that condition can only come in the gridview.
out of 10 rows i need 2,5,7,9,10 rows data.Infact i want to skip the data on some condition.
I s possible with datareader?
if yes how to do?If not how to do?
Please anybody have any idea is helpful for me.
Thanks in advance.
kissy
|
|
|
|
|
I dont know why do you need to use DataReader.
Of course you can do that, just need a counter while you read each datarow from the datareader.
Otherwise, I would suggest to get a DataTable from the sqlStatement and use LINQ or by any means to filter out those rows.
datatable.AsEnumerable().Where(datarow=>{
});
Something like this .
Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution. Visit My Website-->www.abhisheksur.com
|
|
|
|
|
If your datasource is a collection object, then you can use linq to filter the data source and bind the result with the GridView.
Else,
you can filter your data in RowDataBound event,
if(condition)
e.Row.Visible = false;
hope this will help.
|
|
|
|
|
I have given the following code,but still it is displaying all the rows.
If e.Row.Cells(2).Text <> "" Then
If ((e.Row.Cells(2).Text = e.Row.Cells(2).Text) + 1) Then
e.Row.Visible = False
End If
End If
kissy
|
|
|
|
|
try to debug your code you will find the exact problem.
|
|
|
|
|
Kissy16 wrote: If ((e.Row.Cells(2).Text = e.Row.Cells(2).Text) + 1) Then
Check this line !!
Cheers !
Abhijit Jana | MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Normally you would build that condition into your SQL query statement so that the query only returns those rows you want included in the gridview.
- Dave
|
|
|
|
|
I can't give any condition in my sqlquery so that only desired records can come.
From the display only i have to do,can u give something with gridview which can fulfill my requirement ?
kissy
|
|
|
|
|
Instead of binding the SQL command with the gridview, store the results of the SQL query that match your criteria in a dataset. Then bind the dataset with the gridview. I think this is what Abhishek was suggesting as well.
It would look something like:
DataSet myDataSet = new DataSet();
DataTable myDataTable = myDataTable.Tables.Add();
myDataTable.Columns.Add("ID", typeof(int));
myDataTable.Columns.Add("Foo", typeof(string));
myDataTable.Columns.Add("Bar", typeof(string));
connection.Open();
SqlDataReader dr = cmd.ExecuteReader();
while(dr.Read())
{
if (dr["myCriteria"].ToString() == "this")
{
myDataTable.Rows.Add(
(int)dr["ID"],
dr["Foo"].ToString(),
dr["Bar"].ToString()
);
}
}
dr.Close();
connection.Close();
myGridView.DataSource = myDataSet;
myGridView.BindData();
This could be done more elegantly by using myDataTable.Load(dr) then removing the rows that do not meet your criteria via a LINQ statement. But it should give you an idea of what you are trying to accomplish with a DataSet and get you started...
- Dave
|
|
|
|