.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to get toggle/visibility to work properly

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :


I'm having issues getting my toggles to work correctly.  The following example i've provided, I built in a matrix. 

I have a field in my dataset that assigns whether I want the data to show initially.  So in the the Group visibility on the State group, i put in the following expression: =IIF(Fields!isDetail.Value=0,False, True)  This is saying if the state is in Washington or New York show it else, hide the value.

Then in the Contry textbox property of the initially toggle state,  I the following expressions: =IIF(Fields!isDetail.Value =0,True, False)

View Complete Post

More Related Resource Links

Listview Toggle Visibility of a Textbox based on Data Not Null.

I want to toggle a Textbox to be visible (true, false) contained within an InsertItemTemplate based on the data being Null/Empty.   It Works in the Item Template since it is calling the "select parameters", but once it is in the "insert parameters" on databinds, I am unable to get this to work.  <%# String.IsNullOrEmpty(Convert.ToString(Eval("qu_8")))?Convert.ToBoolean("false"):Convert.ToBoolean("true") %> (works in Item Templates, but not in InsertItemTemplate to toggle a textbox to be visible or not visible). I am using C# in code behind. Thanks in advance -Mark

browser history do not work properly

Hi,  I have an ajax enabled asp.net 2.0 page. There are some updatepanels on it and I use the history control to enable the browser history buttons. For first time the AddHistoryPoint method adds a history point to my history control. That works, I think. But on Navigate event, the args.State will contain no key! There is no entry in the dictionary! Therefore my navigation function breaks. Has anybody some similar effect? Or better a solution! Thnxs.

Get the value of hiddenField HTML control not work properly in FireFox


Hi Guys,

I'm trying to access the the value of Hidden field as follows:

var empID= document.getElementById('HiddenField1').value;

It works well in IE but gives null in FireFox

Ajax.BeginForm doen't work properly with AjaxOptions.OnSuccess


Hi All,

I want to use Ajax.BeginForm instead of Html.BeginForm.

I can use it with out OnSuccess option. When I include it, i doesn't save and give validaiton messages.

How can I solve this ?

Kind Regards


Windows Authentication Doesn't work properly



I've implemented Windows Authentication with kerberos protocol.

Each time user visit site they have to hit Sign in button and then they get logged in. IE doesn't recognized automatically user and signed in.

Thanks, Sam

Flash Player Does not work properly on IE6

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="960" height="321"
        id="Object1" align="middle">
        <param name="movie" value="StageBar.swf" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#ffffff" />
        <param name="play" value="true" />

VB.NET Linq - Multiple column Group By using Anonymous types does not work properly


I am attemping to do a multiple column group by in linq using VB.  I've followed a code sample i obtained at the following url:


the sample code is:

GroupBy - Multiple Columns

This sample uses Group By to group products by CategoryID and SupplierID.

Public Sub LinqToSqlGroupBy09()
    Dim categories = From p In db.Products _
                     Group By Key = New With {p.CategoryID, p.SupplierID} Into Group _
                     Select Key, Group

    ObjectDumper.Write(categories, 1)
End Sub

My code result though is not correct, as i am getting duplicates.   The first query is using the data which is stored in a datatable.  The second table pulls the data from a list of objects which i manually built in an effort to get closer to the Example provided above.

Dim listNamesWithSeverity = From myrow As DataRow In dt.Rows _

Trying to Toggle Visibility With 3 Tables and 3 Textboxes



I am trying to create an SSRS 2008 report that will look like it has tabs like an Excel spreadsheet. I have 3 tables (and 3 datasets) and 3 text boxes with an indication in each text box of what the dataset will display to the user. I would like to be able to click on one of the text boxes and have it hide 2 tables, but I don't see any way of doing that. Is there an expression that can be used to hide the other tables when one of the tables is being displayed? I don't want to use a drill-down because it will refresh the data. Subreports do not seem to allow me to reference the text boxes in the main report.

Any ideas would greatly be appreciated.




Can't get multiline to work properly


I am trying to parse a textfile, and I have run into a little problem. In two cases, I can't get my replace to work.

First here is my regex: Regex.Replace(intxt, Chr(34) & ";" & Chr(13) & Chr(10) & ".*?&&", Chr(13) & "&&", RegexOptions.IgnorePatternWhitespace And RegexOptions.IgnorePatternWhitespace And RegexOptions.IgnoreCase And RegexOptions.Singleline And RegexOptions.Multiline)

This should basically say: find ";\r\n and anything else until && and replace with \r&&

If this happens to be on the two consecutive lines it works fine, but the two following cases do not work:

Case 1:



&&4Owned by: BRK Branche";\r\n


Case 2:


v->Fld3.&&6IMPL. NAME:	PPTAR";\r\n
v->Top1.&&2Entity: BET Betingelse\r\n
I thought that selecting singleline as an option would make newline appear as any other char.

As I am probably mistaken, can anybody help me with a regex, that would catch these cases?

I tried my regex in both "RegexBuddy" and "T

RadioButton inside GridView, How to get it work as normal

Did you tried before to drag a RadioButton control inside a Gridivew templatefield, and then you attempt to select these RadioButtons , you will notice that the behavior of RadioButton control will be changed and it will work just like the behavior of checkbox control! the user will be able to select more than one radiobutton in the grid!

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

Tab container rendered with visibility:hidden - This was reported over three years ago.



Here is (more) code that demonstrates the issue.  If the control in the host page is removed the tab control renders correctly.  Otherwise it is rendered with the visibility attrubute set to hidden as reported in the above link.  Is this broken or am I doing something wrong?



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="S2.aspx.cs" Inherits="S2" %>
<%@ Register Src="~/SelectorPatternControl.ascx" TagName="TestControl" TagPrefix="sam" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
        <cc1:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></cc1:ToolkitScriptManager>

Looking for guidance: wanting to work with AJAX architecture



I'm starting a small website that will be backed by a database, and will allow a small number of users to authenticate and select an entry in the database, and then view (and optionally update) a corresponding entry (think master-detail).

I have some flexibility in how I'll do this, but I'd really like to incorperate some newer AJAX style coding, eliminating some page postbacks. I think this is a great opportunity to learn the concepts well.

I'll probably go with an ASP.NET 4.0 site. From what I've seen there are MANY ways to go about this:

-WCF Data Services to expose the data, and consume in ASP.NET

-Page methods to expose the data, separate method to update the data

-I'd rather avoid the UpdatePanel because I'm really looking for a full hands-on approach, with learning client side scripting being an objective as well.

Beyond that, it seems that one can use jQuery to build clientside templates, but also one can use the ASP.NET AJAX template engine (in ASP.NET 4.0 I believe).

A concern I have: users should only be able to work with the data exposed via these endpoints if they are logged into the website. Hopefully I can somehow reuse the ASP.NET forms authentication cookie for this purpose. 

Well, I hope I've posted enough to a

animate effect work but the render items are messed up.


Hi all,

     I have a very unique problem, humm i think. I am using a jquery effect that animate bounce effect, i have a line in my javascript pageLoad function $("#UserBrowserInfoDIV").show('bounce'); - the effects run smoothly but what it does is mess up the bolded text in the div. I have try the items inside the div without bolding and it works fine and no render problem but when bolded the text that are bolded is quite messed up, and barely readable.

Please let me know is there anything else i can do i really would like use this effect.

P.S all the effect have the same render problem, and i am using ie8 under compatibility mode.





Why getTreeNode does not work?



I try to run a  treeview example from msdn:


I also want to use code from


Here is my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register TagPrefix="mytree"
Assembly="Microsoft.Web.UI.WebControls" %>
 <script type="text/javascript" language="javascript">

     function xxx() {

         var myNode = treeview_one.getTreeNode(treeview_one.selectedNodeIndex);


<form id="myform" runat="server">
<mytree:treeview id="treeview_one"  runat="server" Child

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

Category attribute of user control property does not work correctly in categories tab.



I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Category("Styles"), DefaultValue(""), Description("The value for formating something.")]
public String MyFormatProperty
set { /* the code for set */; }
get { /* the code for get */; }

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

Thanks, S.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend