|
I am very glad to know that the link was useful to you.
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
hello, I've embedded some secret on my page:
<br />
HASH_…àEŠ€^×ÓdÔWcuRºû„QP¢„Up<br />
On post back, it became:
<br />
\0H\0A\0S\0H\0_\0…àEŠ€^×ÓdÔWcuRºû„QP¢„Up<br />
The difference between the two is "\0" character. What is it?
Thanks
dev
|
|
|
|
|
devvvy wrote: I've embedded some secret on my page:
Where you have embedded it? On a hidden textbox?
devvvy wrote: The difference between the two is "\0" character. What is it?
In C, \0 is normally used to indicate the end of string. Not sure the same applies to .NET as well.
Probably giving more information about your problem may help. Like, how you are creating and embedding this secret value. How you are reading it etc...
|
|
|
|
|
more detail... err... okay, this dirty little secret contains an Triple DES (TripleDESCryptoServiceProvider) encrypted string (auth token) which I embed in my aspx page for checking {authentication, integrity}. And yes hidden text
I was just wondering why the decrypted string contains '\0', where's that coming from...
dev
|
|
|
|
|
As CG said, it may be unicode strings getting converted. You can try to convert your encrypted string to base 64 string. Base 64 string can be embed on page without any issues.
|
|
|
|
|
yes I already embed and decode using Convert.FromBase64String
I'm thinking manually replace \0 is dumb and will eventually lead me to unemployment down the road
dev
|
|
|
|
|
devvvy wrote: yes I already embed and decode using Convert.FromBase64String
Are you encoding using Base64? The string doesn't looks like a base 64 encoded string.
|
|
|
|
|
yes, the part where I write to and read from ASPX page is done using:
Convert.FromBase64String
and
Convert.ToBase64String
dev
|
|
|
|
|
devvvy wrote: \0H\0A\0S\0H\0_\0
You're probably finding that a unicode string is being converted to bytes, each character has two bytes, and for ASCII characters, the first is a zero.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Many Thanks Lord Graus
dev
|
|
|
|
|
Christian Graus wrote: You're probably finding that a unicode string is being converted
That's a good thought. +5
|
|
|
|
|
Hi all..
i want to add stylesheet to the my hypeerlink value...i added hyperlink in codebehind..i want to change the color of the hyperlink,visited & Hover color like bwlow..
<pre>a.one:link {color: #ff0000}
a.one:visited {color: #0000ff}
a.one:hover {color: #ffcc00}
</pre>
How can i add that color in code behind..??
I just copied thte methos which am using...i underlined the hyperlink value below..
<pre>
public String HideHeader(String sYear)
{
switch (sYear)
{
case "Year1":
if (lblYear1.Text != "0") return "display:block;";
break;
case "Year2":
if (lblYear2.Text != "0") return "display:block;";
break;
case "Year3":
if (lblYear3.Text != "0") return "display:block;";
break;
case "Year4":
if (lblYear4.Text != "0") return "display:block;";
break;
case "Year5":
if (lblYear5.Text != "0") return "display:block;";
break;
case "Year6":
if (lblYear6.Text != "0") return "display:block;";
break;
case "Year7":
if (lblYear7.Text != "0") return "display:block;";
break;
case "Year8":
if (lblYear8.Text != "0") return "display:block;";
break;
case "Year9":
if (lblYear9.Text != "0") return "display:block;";
break;
case "Year10":
if (lblYear10.Text != "0") return "display:block;";
break;
default:
return "display:none;"; //invalid column provided
}
return "display:none;"; //no value found to exist in column
}
public String FormatHyperLink(String sValue, String JurisdictionID, String sYear)
{
#region *** get the year value from the HeaderText ***
switch (sYear)
{
case "Year1":
sYear = lblYear1.Text.Trim();
break;
case "Year2":
sYear = lblYear2.Text.Trim();
break;
case "Year3":
sYear = lblYear3.Text.Trim();
break;
case "Year4":
sYear = lblYear4.Text.Trim();
break;
case "Year5":
sYear = lblYear5.Text.Trim();
break;
case "Year6":
sYear = lblYear6.Text.Trim();
break;
case "Year7":
sYear = lblYear7.Text.Trim();
break;
case "Year8":
sYear = lblYear8.Text.Trim();
break;
case "Year9":
sYear = lblYear9.Text.Trim();
break;
case "Year10":
sYear = lblYear10.Text.Trim();
break;
default:
return "";
}
#endregion
<u>
String sHyperLinkText =
String.Format("MedicalShipments.aspx?Year={0}&State={1}", sYear, JurisdictionID);
if (sValue.Trim() != "0")
{
return "<a title='Click here to view Medical Shipments Files' href='" + sHyperLinkText + "' Target='_self'>" + sValue + "</a>";
}
else
{
return "0";
}
</u>
</pre>
if you want to refer my design part is below..
<pre>
<div style="padding:10px;">
<asp:Panel CssClass="borderPanel" ScrollBars="Auto" Height="150px" Width="500px" runat="server" ID="pnlMain">
<table width="100%" style="padding:5px;">
<tr class="HeaderRowCentered">
<td>Jurisdiction</td>
<td style="<%=HideHeader("Year1")%>"><asp:Label ID="lblYear1" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year2")%>"><asp:Label ID="lblYear2" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year3")%>"><asp:Label ID="lblYear3" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year4")%>"><asp:Label ID="lblYear4" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year5")%>"><asp:Label ID="lblYear5" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year6")%>"><asp:Label ID="lblYear6" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year7")%>"><asp:Label ID="lblYear7" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year8")%>"><asp:Label ID="lblYear8" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year9")%>"><asp:Label ID="lblYear9" Text="" ToolTip="" runat="server"/></td>
<td style="<%=HideHeader("Year10")%>"><asp:Label ID="lblYear10" Text="" ToolTip="" runat="server"/></td>
</tr>
<asp:Repeater runat="server" ID="rptShipments">
<ItemTemplate>
<tr>
<td><%# Eval("JurisdictionDescription")%> (<%# Eval("JurisdictionID")%>)</td>
<td style="<%=HideHeader("Year1")%>"><%# FormatHyperLink(Eval("Year1").ToString(), Eval("JurisdictionID").ToString(), "Year1")%></td>
<td style="<%=HideHeader("Year2")%>"><%# FormatHyperLink(Eval("Year2").ToString(), Eval("JurisdictionID").ToString(), "Year2")%></td>
<td style="<%=HideHeader("Year3")%>"><%# FormatHyperLink(Eval("Year3").ToString(), Eval("JurisdictionID").ToString(), "Year3")%></td>
<td style="<%=HideHeader("Year4")%>"><%# FormatHyperLink(Eval("Year4").ToString(), Eval("JurisdictionID").ToString(), "Year4")%></td>
<td style="<%=HideHeader("Year5")%>"><%# FormatHyperLink(Eval("Year5").ToString(), Eval("JurisdictionID").ToString(), "Year5")%></td>
<td style="<%=HideHeader("Year6")%>"><%# FormatHyperLink(Eval("Year6").ToString(), Eval("JurisdictionID").ToString(), "Year6")%></td>
<td style="<%=HideHeader("Year7")%>"><%# FormatHyperLink(Eval("Year7").ToString(), Eval("JurisdictionID").ToString(), "Year7")%></td>
<td style="<%=HideHeader("Year8")%>"><%# FormatHyperLink(Eval("Year8").ToString(), Eval("JurisdictionID").ToString(), "Year8")%></td>
<td style="<%=HideHeader("Year9")%>"><%# FormatHyperLink(Eval("Year9").ToString(), Eval("JurisdictionID").ToString(), "Year9")%></td>
<td style="<%=HideHeader("Year10")%>"><%# FormatHyperLink(Eval("Year10").ToString(), Eval("JurisdictionID").ToString(), "Year10")%></td>
</tr>
</pre>
somebody asswer to my QQ???
modified on Monday, June 8, 2009 5:24 PM
|
|
|
|
|
This looks very messy. So messy that it made a mess of the forums., If you're posting HTML, then check the box to show the tags, otherwise no-one can read your post, and it can mess with the forums.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Can someone help me to get url variables to output xml in an aspx page ? The code below fails
The page is expecting url variables
courses2.aspx?Profession=Audiology&Framework=UG
This is my code
'url variables
Dim Profession As String = Request.QueryString("Profession")
Dim Framework As String = Request.QueryString("Framework")
' create the connection, DataAdapter and DataSet
Dim connectionString As String = WebConfigurationManager.ConnectionStrings("xxxxxxConnectionString").ConnectionString
Dim sql As String = "SELECT Code, [Certificate Title], Status, [Level], [Total Credits], [Entry Requirements 1], Profession, Framework, Marketing_Text FROM ProgrammesForWeb
WHERE Profession="&Profession&" AND framework="&Framework
Dim conn As SqlConnection = New SqlConnection(connectionString)
Dim da As SqlDataAdapter = New SqlDataAdapter(sql, conn)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "programmes")
response.Write( ds.GetXml() )
|
|
|
|
|
Try
Dim Profession As String = Request.QueryString("Profession")
Dim Framework As String = Request.QueryString("Framework")
Dim sql As String = "SELECT Code, [Certificate Title], Status, [Level], [Total Credits], [Entry Requirements 1], Profession, Framework, Marketing_Text FROM ProgrammesForWeb WHERE Profession=@Profession AND framework=@Framework"
Dim cmd As New SqlCommand(sql)
cmd.Parameters.Add(New SqlParameter("@Profession", Profession))
cmd.Parameters.Add(New SqlParameter("@Framework", Framework))
Dim conn As SqlConnection = New SqlConnection(connectionString)
cmd.Connection = conn
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "programmes")
response.Write( ds.GetXml() )
I didn't get any requirements for the signature
|
|
|
|
|
Many thanks for your quick response, Ive run the code but get an error referring to the connection - Compiler Error Message: BC30205: End of statement expected.
Dim conn As SqlConnection = New SqlConnection("studiesConnectionString")cmd.Connection = conn
Its this part that seems to be the cause - cmd.Connection = conn
Any ideas ?
|
|
|
|
|
Hey all,
Haven't tried this before, and now that I'm thinking to try it, it doesn't appear to work...
Can you place a MultiView inside the ListView's ItemTemplate?
I'd like to show the status for something & various options related to that status in a view.
When each item of in the ListView is rendered, I'd like the MultiView's ActiveViewIndex to be set based on a func in the code behind page, but I also can't seem to find a suitable event to handle to do this check. I was hoping there were a per-item rendering event that I could override....
I want the ListView because I like the layout flexibility, but each item has to display some different controls/info based on the status.
Any suggestions?
|
|
|
|
|
Figured it out eventually, here it is in case someone else is wondering: the key was to handle the ListView.ItemDataBound event, in such a manner:
<code>
protected void MyListView_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
MultiView statusMultiView = (MultiView)e.Item.FindControl("StatusMultiView");
ListViewDataItem dataItem = (ListViewDataItem)e.Item;
DataRowView rowView = (DataRowView)dataItem.DataItem;
if( rowView["MyStatusCol"].ToString() == "something" ))
{
statusMultiView.ActiveViewIndex = ...
}
}
</code>
|
|
|
|
|
Hi,
iam in webapplication using asp.net with c#.
I have to close PopUP Window and pass the session variable to parent form(textbox)..My scenario like..
PopUp window which consists of gridview,with 3 columns.
1-checkbox
2-Name
3.MobileNo..has to select 'N' number of rows...
iam maintaining those selected rows in Session[arraylist]..
when i click close button in PopUp window the Session[arraylist] data should be displayed in parent window [textbox] at the same time PopUP Window should close..
how can i do this ?
murali krishna
|
|
|
|
|
Save the information into Session.
Close the pop up window.
Do a postback of the the opener and load the data in server side code from Session.
I didn't get any requirements for the signature
|
|
|
|
|
avvaru.murali wrote: iam maintaining those selected rows in Session[arraylist]..
when i click close button in PopUp window the Session[arraylist] data should be displayed in parent window
if you are alredy storing data in session, then you need to just refresh parent form to show the data.
|
|
|
|
|
hello !
I am using gridview to display records in my web application.
I have defined two template column each having a asp imagebutton for
delete row and update status respectively.
for deleting row i am using grid rowdeleting event which is working fine
but i am unable to get datakey column value on status imagebutton click.
I also defined one bound column and on the basis of this boundcolumn and primary field column value i have to update status.I got stuck to this problem terribly.
Anyone who knows please tell how on imagebutton click that particular row can be access.I want that particular row's primary key field(or datakey value as primary key column is assigned to this) and bound column value
please send me the code or solution ASAP as its urgent.
Any help will be highly appreaciated.
Thanks in advance!!
|
|
|
|
|
d_smit wrote: please send me the code or solution ASAP as its urgent.
Almost had me there until I saw this. Don't be rude and you might have gotten an answer. It may be urgent to you but not anyone else here.
only two letters away from being an asset
|
|
|
|
|
Well...the imagebutton is the sender
ImageButton btn = (ImageButton)sender;
the imagebutton is in the container of the row
GridViewRow row = (GridViewRow)btn.NamingContainer;
(you now can use the row.SelectedValue for your DataKey)
The gridview row is in the container of the gridview
GridView grd = (GridView)row.NamingContainer;
....use this answer quickly! cause it might be urgent!
It is more polite not to tell in you question that it is urgent. Why you did not post your question when you did not run out of time!
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
which of the following two options 'Cross Page Postback' or 'Server transfer' is the most preferred option.
I need to transfer from one page to another page on the click on a button.
Thanks,
NetQuestions
|
|
|
|