Data Controls :: Show Hide HyperLink Control In DataList Based On Session Value

May 7, 2015

Actually I have a datalist in which I am binding product name and product description and there is a hyperlink.

I am binding datalist in page load and checking that user is login or not using session.

if user is login then hyperlink text should be view more

else

hyperlink text should be login to view 

The code I have written is working fine but when user is logged in then Only one products hyperlink text changing. I want change it to all hyperlink text to view more when user login

View 1 Replies


Similar Messages:

Data Controls :: Dynamically Show Hide Label And HyperLink Based On Condition In Same Column Of GridView

May 7, 2015

I am checking string  and then bind category. If condition is false then i  need anchor tag in which i pass querystring to specific link.

<itemtemplate>
<asp:Literal runat="server" ID="litPrice" Text='<%#((String.IsNullOrEmpty(Eval("Price").ToString()) || Eval("Price").ToString()=="00/0.00" || Eval("Price").ToString()=="0/0.00") ? "<span font-family="arial"><a href="http://www.xyz.com/web/enquiries.asp?category="+ Eval("category")>Enquiry</a></span>" : Eval("Price"))%>' >
</asp:Literal>
</itemtemplate>

I am getting error. CS1010: Newline in constant

View 1 Replies

Data Controls :: Show Or Hide Image Control In GridView Based On Condition From Database

Dec 19, 2012

i am using template field display image based on condition in table field. i have field name  verify i used to store yes or no value if it is yes then display image else noting to display in gridview

View 1 Replies

Forms Data Controls :: ItemTemplate - Hide A Hyperlink Based On The Value Of A Column?

Apr 1, 2011

I have a gridview and in the gridview i have a an itemtemplatefield with a regular html hyperlink in it.

Based on the value of one of the columns in the gridview, i want to hide this hyperlink and just replace it with the value of another column

e.g. <a href="page.aspx?x=<%=Me.CurrentAgent.ID %>&id=<%# Eval("Id") %><%# Eval("Customer") %></a>

if Eval("Status") = 123 then instea of the above hyperlink, i just want <%# Eval("Customer") %>

View 2 Replies

Forms Data Controls :: Toggle Show/hide Details In Datalist Using Javascript?

May 30, 2010

I have a datalist bound to a sql source having two columns: Name and Description. The datalist contains a "Show Description" link as follows on clicking on which it calls the javascript which shows the description div.

[Code]....

The asp.net page source for itemtemplate of the datalist is as follows.The problem is that since the div id "Description" is applicable to multiple records, no matter I click on whichever "show details" link, the description of first record in the datalist is shwon and hidden since its the first div encountred by the javascript. In other words, I want a way to show/hide the description of each record in datalist indivigdually.
[Code]....

View 8 Replies

Forms Data Controls :: How To Hide/show Columns Based On The Dropdownlist Value

Jul 16, 2010

I have an emergency request that I need to sort it out very quickly as I did not notice it early :(.

I have a dropdownlist, the contnet in the gridview (sqldatasource connection) changes based on the value the user slects, say I have play1, play2 from the dropdownlist, I would like to show column1, column2 and column3 with user selects play1; show column4, column5, and clomn6 when use selects play2; the datatable actually includes all 6 columns.

I understand that I need to use something like RowCreated event, and I need to set up condition based on the dropdownlist value, but I dont really know how to.

View 3 Replies

Forms Data Controls :: Show / Hide Detailviews Based On Querystring

Oct 22, 2010

I have a form that has 2 querystring variables ID and FormID being passed to the page. Also on this page I have 2 different DataSources that outputs to a Detailview depending if the FormID is 1 or 2. I would like to be able to add a show/Hide command to Show only the DetailView that is selected and Hide the other. I have researched and found hat people are using a Multiview code, but I have not been able to find a working example code.

View 2 Replies

Data Controls :: Show Hide CommandButton Based On Condition In GridView

Nov 22, 2015

I am adding two button in gridview here I populate gridview on page load this work fine problem is that  when my status value are  check  or peending then my two button are show.

But I want when my status value are check then check  button  should be hide

And view button show in which row where staus value  are check But when my status value are peending here show check button and view button should be hide. I want follwing type .

Gridview Like that on page load

id name class status

1 imran 5 check

Hide Check button
View Button Show

2 ali 8 pending

Check  Button Show
View Button Hide

3 farooq 7 check

Hide Check button
View Button Show

How to do it following my code.

Default.Aspx.cs
protected void Button1_Click(object sender, EventArgs e)
{
populategridview();
}
public void populategridview()
{
string strConnString = "Data Source=.SQLEXPRESS;Integrated Security=SSPI;

[Code] .....

View 1 Replies

Forms Data Controls :: Show / Hide Textbox In Formview Based On A Dropdown?

Sep 29, 2010

I have a textbox in a formview as well as a dropdown. When I select a value in the dropdown, the textbox should be made visible or invisible based on the value I select.

View 3 Replies

Data Controls :: Show / Hide TextBox Based On Value Of DropDownList Inside GridView?

May 7, 2015

This is my Code

My query is if i select Other in dropdownlist i want visible textbox..

how to i do it..

<asp:GridView ID="TypeFruit" runat="server">
<Columns>
<asp:TemplateField HeaderText="Type" >
<ItemTemplate>
<asp:DropDownList ID="ddlfruit" runat="server" >
<asp:ListItem Value="0">Select</asp:ListItem>
<asp:ListItem Value="1">Fruit</asp:ListItem>
<asp:ListItem Value="2">Other</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="TxtOther" runat="server" Visible="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView> 

View 1 Replies

Forms Data Controls :: Show - Hide Template Headertext In Gridview Based On Requirement

Mar 30, 2010

I am using VS2008.I am binding dynamic datatable to gridview. I have few dropdowns and textboxes in gridview.
I have dropdownlist(ddlTrCodeNw_)in gridview foooter template. Based on the selection of Trcode value few controls will be enabled,disabled,visible,hide. in gridview.

<asp:GridView ID="gvAPPost" runat="server" Width="100%" ShowFooter="true"
AllowPaging="true" AutoGenerateColumns="false"
onrowcommand="gvAPPost_RowCommand"
onrowdatabound="gvAPPost_RowDataBound"
>
<Columns>
<asp:TemplateField HeaderText="Discount %" Visible="false">
<FooterTemplate>
<asp:TextBox ID="txtDiscountPerNw" runat="server" Width="40px" Enabled="false" Visible="false" ></asp:TextBox >
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="txtDiscountPer" runat="server" Width="40px" Enabled="false" Visible="false"></asp:TextBox >
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Intially I set TemplateField HeaderText also Visible="false".
so i have written the condition in ddlTrCodeNw_SelectedIndexChanged.
Now when
if(ddlTrCodeNw.SelectedValue=="24")
{
txtDepstNw.Enabled = true;
txtDepstIncNw.Enabled = true;
txtCrdtNw.Enabled = false;
txtCrdtIncNw.Enabled = false;
lblDiscTrcodeNw.Visible = true; // I want to show this TemplateField HeaderText also when i need.
}

I can I show TemplateField HeaderText also whenever i need.

View 3 Replies

Data Controls :: Show / Hide TextBox Based On Selected Value Of DropDownList Inside GridView

May 7, 2015

In my query i have 1 gridview..

In this gridview i have 1 dropdownlist and  1 textbox..

textbox is in visible=false state..

My question is after selecting dropdown list selected value i want visible textbox in gridview..

View 1 Replies

AJAX :: Show Hide Image Control On Page Based On Database Value

Dec 14, 2013

Below is House_info table

id name behcode

1 Neda 1111
2 Jack 2222
3 Sara 3333

House_p table

id Product behcode

1 sofa 1111
2 iron 1111
3 scarf 2222

and below is SP

ALTER procedure [dbo].[storeinfo1]
@Behcode nvarchar(10)
as
begin
select behcode,Name
,(select Behcode from House_p where BehCode=@Behcode) behcodeP
from House_Info
where BehCode=@Behcode
end

I have image=>Productimage  in product.aspx page I want if in House_p table there be my users behcode it do Productimage.visible=true 

i.e

In House_info table exist user Sara with behcode=3333  her behcode  isn't in House_p table so I want in product.aspx page ProductImage.visible=true

How I can do it?

View 1 Replies

Web Forms :: Hide Show Tabs Of TabContainer Control Based On Condition

May 13, 2012

I have a tab container with 10 tabs each with unique id on a hyperlink click i need to make some tabs visible true false,in hyperlink I am passing a query string param

if the param="Y" param = Request.QueryString["type"]; 
if  (param == "Y") { 
for (int tc = 0; tc <= TabContainer1.Tabs.Count - 1; tc++) { 
if (TabContainer1.Tabs[tc].ID == "Y") {
TabContainer1.Tabs[tc].Visible = true;                           
} else {                               
TabContainer1.Tabs[tc].Visible = false:
} } }

I have the above condition but on this click the tab container is not at all visible but without any parameter passing the tab container is visible.

View 1 Replies

Forms Data Controls :: Using Hyperlink Control With DataList?

Mar 9, 2010

I have a datalist that displays text which links to another page. Depending on which value is selected the data shows the relevant data for the selected record. Using the code below I have tried to insert the 'RecId' value into the url to get the correct data but I get an error because the syntax is wrong.

<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" ShowFooter="False" ShowHeader="False">
<ItemTemplate>
<asp:HyperLink ID="EventDescLabel" runat="server" NavigateUrl=http://www.MySite.com/Courses/tabid/98/ModuleID/509/ItemID/" & '<%# Eval("RecId") %>' & "/mctl/EventDetails/Default.aspx"
Text='<%# Eval("EventName") %>' />
</ItemTemplate>
</asp:DataList>

View 4 Replies

Forms Data Controls :: Hide Submit Button If Datalist Control Is Empty?

Jul 16, 2010

I would like to hide a submit button if a DataList is empty. I don't really know the code. If you submit an answer please show me the code also. I have to do it in VB.Net. I googled and found the following code that I place in the code behind under the Page load event.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dv As DataList
dv = SqlDataSource3.[Select](DataSourceSelectArguments.Empty)

[code]...

View 6 Replies

Data Controls :: How To Hide Show Panel Based On Date Time And Current Date

Oct 8, 2013

Here what i am trying to accomplish. I want to have a div or panel on the page and have some text on it. The div or panel must hava a specfied time limit and then disaaper from the page. Say i want this text to apper on 10Cotober 10.00  and disapper from the page on 11October 18.00. 

View 1 Replies

Data Controls :: Disable Or Hide DropDownList Control Based On Condition In GridView

Dec 18, 2013

I am using a dropdownlist in a gridview which contains 3 valuesappleorangebanana

apple will be displayed as default valueif i select orange and banana the dropdownlist list should be disable or hidden but the selected value must be displayed

protected void btnsubmit_Click(object sender, EventArgs e)
{
foreach (GridViewRow gr in GridView1.Rows)
{

[Code].....

View 1 Replies

Forms Data Controls :: How To Control The Hide/show Of Subitems

Feb 14, 2011

I basically need some items in a grid however each item contains subitems so I need a +/- type button to show/hide them. Is there a control to do this or would it be easier to simply put them in a CSS table and use jquery or something similar to control the hide/show of subitems?

View 1 Replies

Forms Data Controls :: Show / Hide GridView Control?

Jul 22, 2010

Protected Sub SQLDShowActionRef_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SQLDShowActionRef.Selected

View 4 Replies

Forms Data Controls :: Show / Hide Control Inside A Listview?

Aug 8, 2010

I have a listview and in each there is a dropdownlist and a textbox. The textbox is invisible. When I change a value on the ddl it fires the SelectedIndexChangedMethod. In here, if the ddl is certain value I want to show the textbox thats on the same row. How do I grab the textbox from inside this method?

Code:

<asp:ListView ID="lvBillingQueue" runat="server" OnItemDataBound="lvBillingQueue_ItemDataBound"
OnPagePropertiesChanging="lvBillingQueue_PagePropertiesChanging" DataKeyNames="ID">
<LayoutTemplate>
<table width="100%" cellspacing="1" cellpadding="3" border="0">

[Code]....

View 18 Replies

Web Forms :: Xml Data Source Based Bounded Treeview - Hide Some Nodes Depend On User Session?

Jan 6, 2010

I am binding a treeview with XmlDataSource. On my login page I want to hide some node like

see my login code

if (Session["uname"] != null)
{
if ((Session["uname"]).ToString() != "")
{
if ((Session["UserType"]).ToString() == "Administrator")
{ dont hide nodes }
else { hide some nodes}
}
else
{
Response.Redirect("index.aspx");
Session["uname"] = "";
}
}
else
{
Response.Redirect("index.aspx");
Session["uname"] = "";
}
}

so how to do that, if you need my .aspx code for treeview so free to ask.

View 2 Replies

Data Controls :: Show Hide Panel Control Inside GridView Row On Button Click

Aug 18, 2015

I want to open asp panel inside gridview selected row and the panel is placed outside the gridview(above gridview) using javascript or jquery.

View 1 Replies

Forms Data Controls :: How To Show Label Control Text Based On Gridview Value

Dec 9, 2010

I am developing a form where I have a gridview control which I shows data from sql database. Sql query:

I also have a label control. What I want to do is to show label control when gridview cell value is > 3.

Could you tell me if it is possible to make label control visible based on gridview value?

Here is my code:

[Code]....

View 3 Replies

Forms Data Controls :: DataList No Results / Access Datasource On The Page With A Datalist To Show The Data?

Nov 15, 2010

The problem is that i have a search page. Access Database holding the information. I have a Access Datasource on the page with a Datalist to show the data. I need to find a way on setting it up to says "Sorry no results found" when the is no results. i am unsure on how to do this though.

Below is my datasource and datalist

[Code]....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved