I am using a nested repeater to display users popsts and replies to the posts. The posts can be two different types, just a comment, or a comment with statistics. To display the stats column, I am building the data in the SQL like:
This displays Ride Time as HH:MM. I am bolding the header (RT) with the <strong> embedded in theSQL. If I bind the result into a gridview, where I can turn the HTML Encode property = false, the RT is bolded. Is there a way to accomplish this in a repeater?
We are using gridview to display data and detailsview to show details, update, insert, and delete as needed. I am a bit confused on whether or not htmlencode and htmldecode is needed when storing data from detailsview. Gridviews always use boundfields and I think encoding and decoding is built in. For detailsview we use mostly templatefields (eval(), bind()), some boundfields, and some data is stored in codebehind using e.values or e.newvalues.Here is where I've got the idea:http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.itemupdated.aspxIf I use the iteration and htmlencode, detailsview read only mode displays decoded data. However, gridview displays encoded data and of course update mode of detailsview. So, it seems like detailsview using htmlencode and htmldecode somewhat, but I am not clear as to what degree and what would be the best way to handle it.
I have a user control that displays a shopping cart in an ecommerce application.
The main cart display is a repeater that renders as a html table. In one of those table columns, there is another repeater to display people associated with the products int he cart (it's a repeater in case there is a line item >1 with multiple people).
I've added an ImageButton that I want to use to change the person associated with the item. At first, when I'd click on it I was getting this error:
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.
So as an experiment I disabled EventValidation on the page (not the control it's self) and now I do not get an error, but I also do not ever hit the breakpoint I set in the innermost repeater's ItemCommand event.
So I wonder how I might do this without disabling EventValidation, because this control will show up on multiple pages and we don't want to edit them all. Also, I'll need to know not only the repeater containing the control's row that the event came from but also the row index of the repeater containg this one. Is this possible?
I'm so confused I wasn't even sure what to make the title so that it would make sense.
Here is what I have:
what changed do I need to make to my code for it to achieve what I'm after.
At the moment I am getting a "cannot cast to type" error message with the below code.
I have also tried calling the ItemDataBound method in with the parent repeater tags and had no errors but when I clicked on the button it would just move back to the top of the page and would not hide or show any data. Also I have made the div style to none but the first record still shows its child but the rest don't.
I have a url which I wish to encode that contains a couple of encrypted querystring parameters:
I've been asked by a client I'm working with to html encode this url. I've used HttpUtility.HtmlEncode() to do this. This returned the following:
This appears to be correct as the '&' has been replaced with '&'. However a problem arises when I try to use HttpUtility.HtmlDecode() on this new value as I get the following returned:
What appears to have occurred is the '&' has had the 'amp' removed and the ';' has been html encoded (I checked the value of '%3b' and it corresponds with the html encoded value of a semi-colon). I'm not sure why this is happening?
I realise I could manually do a .Replace("%3b", "") as a temporary fix but I can't see this being a good long-term solution.
For protect against XSS we should make all input from textboxes thoht Server.Htmlencode function.
1) If i let a input go thorgh Server.Htmlencode and save it in database. But what happen if i letter show this input data from database on browerser ...if database input data have <script> it will then make Xss!!!!.
2) I use Server.Htmlencode.. and the user write <b>ss<b>... (label.text = userinput.text;) and i WANT to show ss in browser. What shuld i do for make this happen ??
I am trying to set up a POST from one aspx file to another progromatically. Inside the POST is a String of XML data which i have properly added to Server.HtmlEncode(). For some reason, when I grab it in my logs on the other page, it is showing with 3 question marks. I at first thought it was logging text i left somewhere, but have narrowed it down to a Encoding error of some sort because when i change the encoding it changes the character, and when I just put some text in there, i see it on the other side fine. i have tried UTF 8,UTF32,Unicode,ASCII... Can't seem to find the right combination. Can't find the UTF-16 when I use the Encoding object
Below is my Code:
[Code]....My Sending Debug log has the Extension xml coming out in HTML format correctly before POST. Below is just a piece of it[Code]....
I have nested a repeater control in Gridview. Right now it is showing gridview rows and repeater header for every case(whether data is there or not for that particular grid view row in the repeater control). I want to hide the gridview row and repeater control header when there is no data present for that particular gridview row. That case I handled at code level by filtering the resulted data table.
Now the another problem I am facing: I have allowed the paging on the gridview i.e. pagesize 3. When page loads it works fine, but when I go to page 2 then it generates following error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Below is the code to fill the grid, paging and fill repeater on rowdatabound event of grid.
I have a repeater that has a delete button in it.When the delete button is clicked the panel updates and returns, then the row is deleted.So the deleted row stays in the repeater until i navigate away and then come back to the page. I commented out the update panel and all is good except i really want the update panel as the flicker is not pritt
I have a gridview which is present inside a repeater. I have been successful in displaying the data inside the grid view. Now I want to fetch data from the gridview. But i have not been able to fetch the data from the grid view.
I have a repeater control bound to a dataset. Within that repeater I have several further controls one of which is a dropdownlist. I trap the OnSelectedIndexChanged event of that dropdownlist because I want to recalculate some figures presented on the same row within the repeater.
How do I reference other controls which are on the same row of the repeater as the dropdownlist ? Is there an index property or other mechanism whereby I can identify the "current" row?