Listview Control validationhttp://forums.asp.net/t/1790232.aspx/1?Listview+Control+validationTue, 10 Apr 2012 07:39:54 -040017902324920774http://forums.asp.net/p/1790232/4920774.aspx/1?Listview+Control+validationListview Control validation <p>Hi</p> <p>&nbsp;i have a listview to bind the two forms data in one listview. its ll work. i want to differnciate the &nbsp;data , this is home page ,this is about page.</p> <p>i want to show these detail in image. i ll insert image also. how to validate &nbsp;to show the image in regarding data based. can you help me. please...........................&nbsp;</p> <p></p> 2012-04-07T11:31:23-04:004922362http://forums.asp.net/p/1790232/4922362.aspx/1?Re+Listview+Control+validationRe: Listview Control validation <p>Hi,</p> <p>I am so sorry but I can't understand what you want to do. do you mean you have a page with ListView control, you can redirect to this page from home page or about page, and you want to do is specify what is the data source of ListView from?</p> <p>Please describe it in details or you can post your code here, thanks.</p> 2012-04-09T06:49:00-04:004922378http://forums.asp.net/p/1790232/4922378.aspx/1?Re+Listview+Control+validationRe: Listview Control validation <p>hi</p> <p>i have an listview control. i ll retrive the data in database. its working properly. what i want mean &nbsp;single table i ll add the two types of data.</p> <p>i ll retrive two types of &nbsp;data in different page. its working. &nbsp;while iam retrive data i want to know this is this page data. this is another page data. so i go with that why should you for insert a image....... &nbsp;this is my requirement. i don't want to insert image in database. with out data base how should i slove this issue.</p> <p></p> 2012-04-09T06:58:16-04:004922450http://forums.asp.net/p/1790232/4922450.aspx/1?Re+Listview+Control+validationRe: Listview Control validation <p>Hi,<br> Thank you for your response so quickly!<br> However, I am still not clear about what is your purpose. <br> </p> <blockquote><span class="icon-blockquote"></span> <h4>SudhaRubini</h4> so i go with that why should you for insert a image....... &nbsp;</blockquote> <br> Could you clarify above more clearly? Could you please provide more information about your code? That will help us to continue. Thanks <p></p> 2012-04-09T07:44:48-04:004922463http://forums.asp.net/p/1790232/4922463.aspx/1?Re+Listview+Control+validationRe: Listview Control validation <p>Hi</p> <p>&nbsp;its &nbsp;correct your view....</p> <p>but if i show text mean &nbsp;its look is not nice. the page fully text........ my client asking me.... so i go with that ........</p> <p></p> 2012-04-09T07:53:01-04:004922651http://forums.asp.net/p/1790232/4922651.aspx/1?Re+Listview+Control+validationRe: Listview Control validation <p>Hi,</p> <p>Sorry I am still feel puzzled about your explanation, Can I take it like this:</p> <p>I can visit the page with ListView control by click links from different pages, different pages transfer different values to the ListView page, then I retrieve image info from database table according to these different values.</p> <p>I write a simple demo to show what I expressing:</p> <p>create table(different pages mapping different images):</p> <pre class="prettyprint">CREATE TABLE [dbo].[Page2Image]( [page_url] [nvarchar](50) NOT NULL, [image_url] [nvarchar](50) NOT NULL, [ext] [nvarchar](50) )</pre> <p>.aspx page:</p> <pre class="prettyprint"> &lt;asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1"&gt; &lt;LayoutTemplate&gt; &lt;span id="itemPlaceholder" runat="server"&gt;&lt;/span&gt; &lt;/LayoutTemplate&gt; &lt;ItemTemplate&gt; Hello, You come from &lt;%# Eval("page_url") %&gt;&lt;br /&gt; &lt;img src='&lt;%# Eval("image_url") %&gt;' alt="" /&gt; &lt;hr /&gt; &lt;/ItemTemplate&gt; &lt;/asp:ListView&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.\SQLEXPRESS;Initial Catalog=TestDB;Integrated Security=True" ProviderName="System.Data.SqlClient" &gt; &lt;/asp:SqlDataSource&gt;</pre> <p>code-behind:</p> <pre class="prettyprint"> string url = Request.QueryString["from"]; SqlDataSource1.SelectCommand = "SELECT * FROM [Page2Image] where [page_url]=@url"; SqlDataSource1.SelectParameters.Add("url", url);</pre> <p>links of different pages:</p> <pre class="prettyprint"> &lt;a href="WebForm3.aspx?from=WebForm1.aspx"&gt;WebForm3.aspx&lt;/a&gt;</pre> <p>I am sorry I can't understand your meaning accurately, if you sent your code and explain it more clear, I can help you. You can refer to this temporary.&nbsp;</p> <p>If you still have any doubts, welcome ask me.</p> 2012-04-09T09:41:48-04:004922729http://forums.asp.net/p/1790232/4922729.aspx/1?Re+Listview+Control+validationRe: Listview Control validation <p>hi&nbsp;</p> <p></p> <p>This is my code</p> <p>&lt;asp:View ID=&quot;view5&quot; runat=&quot;server&quot;&gt;<br> &lt;table style=&quot;margin-top:30px;&quot;&gt;<br> &lt;tr&gt;<br> &lt;td valign=&quot;top&quot;&gt;<br> Highlight Content<br> &lt;/td&gt;<br> &lt;td valign=&quot;top&quot;&gt;<br> &lt;asp:TextBox ID=&quot;txtFirstData&quot; runat=&quot;server&quot; Height=&quot;50px&quot; TextMode=&quot;MultiLine&quot; Width=&quot;400px&quot;&gt;&lt;/asp:TextBox&gt;<br> &lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;txtFirstData&quot; ErrorMessage=&quot;Highlight Content Can't be blank&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;<br> &lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td&gt;&lt;asp:RadioButton ID=&quot;Rb_HomeHighLights&quot; runat=&quot;server&quot; Text=&quot;NewsHighLight&quot; GroupName=&quot;News&quot;/&gt;&lt;asp:RadioButton ID=&quot;Rb_CourseNews&quot; runat=&quot;server&quot; Text=&quot;CourseNews&quot; GroupName=&quot;News&quot; /&gt;&lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td colspan=&quot;2&quot; align=&quot;right&quot; style=&quot;padding-right:180px;&quot;&gt;<br> &lt;asp:Button ID=&quot;btnHighlightSave&quot; runat=&quot;server&quot; Text=&quot;Save&quot; <br> onclick=&quot;btnHighlightSave_Click&quot; /&gt;<br> &lt;asp:Button ID=&quot;btnHighlightUpdate&quot; runat=&quot;server&quot; Text=&quot;Update&quot; OnClick=&quot;btnHighlightUpdate_Click&quot;/&gt;<br> &lt;asp:Button ID=&quot;btnCancel&quot; runat=&quot;server&quot; Text=&quot;Cancel&quot; CausesValidation=&quot;false&quot; onclick=&quot;btnCancel_Click&quot; /&gt;<br> &lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;/table&gt;<br> &lt;/asp:View&gt;</p> <p></p> <p></p> <p></p> <p></p> <p>&lt;div style=&quot;margin-top:30px;&quot;&gt;<br> &lt;asp:ListView ID=&quot;lstinfo&quot; runat=&quot;server&quot; OnPagePropertiesChanging=&quot;lstinfo_PropertiesChanging&quot;&gt;<br> &lt;LayoutTemplate&gt;<br> &lt;h2&gt;Active Record&lt;/h2&gt;<br> &lt;table border=&quot;1&quot; class=&quot;wabttable&quot; style=&quot;border-collapse:collapse; width:100%;&quot;&gt;<br> &lt;thead&gt;<br> &lt;tr class=&quot;thcolor&quot;&gt;<br> &lt;th&gt;S.No&lt;/th&gt;<br> &lt;th&gt;Highlight Content&lt;/th&gt;<br> <br> &lt;th&gt;Action&lt;/th&gt;<br> &lt;/tr&gt;<br> &lt;/thead&gt;<br> &lt;tbody&gt;<br> &lt;asp:PlaceHolder ID=&quot;ItemPlaceHolder&quot; runat=&quot;server&quot;&gt;&lt;/asp:PlaceHolder&gt;<br> &lt;/tbody&gt;<br> &lt;/table&gt;<br> &lt;/LayoutTemplate&gt;<br> <br> &lt;EmptyDataTemplate&gt;<br> &lt;asp:Label ID=&quot;lblNorecord&quot; runat=&quot;server&quot; Text=&quot;No Record Found&quot; ForeColor=&quot;Red&quot;&gt;&lt;/asp:Label&gt;<br> &lt;/EmptyDataTemplate&gt;</p> <p>&lt;ItemTemplate&gt;<br> <br> &lt;div id=&quot;Left-Panel&quot;&gt;<br> &lt;tr &lt;%# (Container.DataItemIndex % 2 ) != 0 ? &quot;style = 'background-color:#CFeeA7;' &quot; : &quot;&quot; %&gt;&gt;<br> &lt;td width=&quot;50px&quot; align=&quot;center&quot;&gt;<br> &lt;asp:Label ID=&quot;lblHighlightIndex&quot; runat=&quot;Server&quot; Text='&lt;%# Container.DataItemIndex &#43; 1%&gt;' /&gt; <br> &lt;/td&gt;<br> &lt;td&gt;<br> &lt;asp:Label ID=&quot;lblData&quot; runat=&quot;Server&quot; Text='&lt;%#Eval(&quot;FirstContent&quot;) %&gt;' /&gt;<br> &lt;/td&gt;<br> &lt;td align=&quot;center&quot; width=&quot;200px&quot;&gt;</p> <p><span style="text-decoration:underline">&lt;%--&lt;%#(Convert.ToInt16)Eval(&quot;PageId&quot;) == 55 ? &quot;../../images/icon_library.png&quot; : &quot;../../images/icon_container.gif&quot;%&gt;--%&gt;</span></p> <p>&lt;asp:LinkButton ID=&quot;lnkedit&quot; runat=&quot;server&quot; OnClick=&quot;lnkedit_Click&quot; CommandArgument='&lt;%#Eval(&quot;Id&quot;) %&gt;' &gt;Edit&lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;<br> &lt;asp:LinkButton ID=&quot;lnkdelete&quot; runat=&quot;server&quot; OnClick=&quot;lnkdelete_Click&quot; CommandArgument='&lt;%#Eval(&quot;Id&quot;) %&gt;'&gt;Remove&lt;/asp:LinkButton&gt;<br> &lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;/div&gt;<br> &lt;/ItemTemplate&gt;<br> &lt;/asp:ListView&gt;<br> &lt;/div&gt;</p> <p>if click homehighlights option mean the list show the image on home. if click newshighlightoption &nbsp;mean the list view show news icons. this is my requirement</p> <p></p> 2012-04-09T10:17:04-04:004924234http://forums.asp.net/p/1790232/4924234.aspx/1?Re+Listview+Control+validationRe: Listview Control validation <p>I do really feel so sorry that response you so late, but I am still feel puzzle about your code.</p> <p>I have copied your code you showed in your post and I read it carefully. as you said,</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>SudhaRubini</h4> if click homehighlights option mean the list show the image on home. if click newshighlightoption &nbsp;mean the list view show news icons.</blockquote> <p></p> <p>I can find out the NewsHighlight radio button, is that your newshighlight option? but I can't find out the homehighlight option.&nbsp;Corresponding with the newshighlight radio button is the CourseNews radio button.</p> <p>I discussed with my friend and we tried to follow up your mind, we both can not accurately understand your meaning.&nbsp;</p> <p>If you have an special column to identity what category the current record belong to(homehighlight option or newshighlight option) in your table? When you save or update a record, or you show images in the ListView, you always refer to the value in this special column?</p> <p>If you not have that special column, please think about my idea. Or you can describe with more details, Or you can upload more code to skydrive and post the link, I will download it, test it and give you a satisfactory result.</p> 2012-04-10T07:39:54-04:00