473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ASP.NET 2.0 FormView with

Hello,

I have two FormViews that I am using. One is used just to show some data,
so it is always in ItemTemplate view. The second FormView is used as an
approval section for the first FormView. In the first FormView I am showing
the name wrapped in a html email tag coming from SQL Server. The problem
that I am having is that when I click the "update" or "cancel" link in the
second FormView, I get the "potentially dangerous" error statement. My
question is there a way to wrap the email link so that I don't get this
error and am able to use the email link?
--
Thanks in advance,

sck10
From SQL Server
-------------------
'<a href="mailto:' + Email + '">' + FirstName + ' ' + LastName + '</a>' +
'&nbsp;' AS 'strNameTel'

<ItemTemplate>
<tr>
<asp:Label ID="lblNameEmailItem" Text='<%# Eval("strNameTel") %>'
runat="server" /></td>
</tr>

Error Statement
----------------
A potentially dangerous Request.Form value was detected from the client
(ctl00$cphMainContent$hdnSubmitter="<a href="mailto:sck10...").
Apr 19 '06 #1
1 2656
Hi Sck10,

Thank you for posting.

Regarding on the FormView databindig warning issue you mentioned, based on
my experience, it is caused by the ASP.NET Label control's security code
validation. In your case, you dynamically generate some html markup code in
T-SQL and output it onto ASP.NET page through a Label. Since Label control
does not do htmlencoding on the text bound to it, the runtime will alert
warning if he detect any markup or script code(since the code or script may
come from malicious users ).

So for your scenario, if you want to add such dynamic email link, I
strongly recommend you consider construncting the email link in ASP.NET
databinding stage. You can either use a ASP.NET built-in hyperlink control
or just use string concatenate. For example, below is the code snippet on
using hyperlink control with databinding expression to construct such a
email link from database fields:

<asp:HyperLink ID="HyperLink1" runat="server"
Text='<%# Eval("fname") + " " + Eval("lname") %>'
NavigateUrl='<%# Eval("email","mailto:{0}")
%>'></asp:HyperLink>
Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:" System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
0
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase...
7
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the...
3
by: sck10 | last post by:
Hello, I am trying to bind an arraylist to a FormView DropDownList control in the PreRender state. The error that I get is the following: Databinding methods such as Eval(), XPath(), and...
4
by: J055 | last post by:
Hi I have 2 update buttons in my FormView ('Apply' and 'OK'). I want both buttons to update the data source but the 'OK' button should redirect afterwards. I can see which button is clicked...
2
by: sck10 | last post by:
Hello, I have 3 objects: LinkButton GridView FormView The LinkButton is used to open the FormView in Insert mode. The GridView provides a list of products. When the "Select" link is
0
by: =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?= | last post by:
Hello, I read some msdn and other articles about how does databinding among DataSource controls and FormView / GridView controls works but I still don't fully understand to this blackbox. I have...
0
by: LiamLiamLiam | last post by:
G'day all. I having a problem with my formview. I'll ty to explain my situation as best as i can. I have a page with a search field at the top which is just a simple asp:textbox. Below that i...
6
by: Chris | last post by:
I want do my insert to a database using a formview bound to an objectdatasource. I also want to upload a file. I'm quite new to and this is just test code but Is there any way I can pass the file...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.