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

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

Can't get multiline to work properly

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :WPF

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

View Complete Post

More Related Resource Links

Multiline Option does not work

Hi,Below is the sample piece of code(The code is in VB.NET), where I am expecting an answer of "true" with my basic knowledge of Regular Expressions.---------------------------------------------------'VB   Dim r As New Regex("^def$", RegexOptions.Multiline)   Dim d As String = String.Format("{0}{1}{2}{3}{4}{5}", "abc", System.Environment.NewLine, "def", System.Environment.NewLine, "def", System.Environment.NewLine) MsgBox(r.Match(d).Success)-----------------------------------------------------------The answer I get is false, but there are two "def" in 2nd  and 3rd line of the data and Multiline option is enabled, I have checked it with VS 2005 and VS 2008, both give me answer as false.  What is the mistake I have done? Please help.Thanks and Best Regards,Bennz Benz

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 _

How to get toggle/visibility to work properly



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)

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!

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.

Intermittant error: "A connection attempt failed because the connected party did not properly respon



I'm having a doozy of a problem, and can't find a solution.  I have a WFC Web Service installed to a pair of servers, and accessed through a load balancer.  I am accessing the service from an ASP.NET client app, also via WCF.  The Client is not load balanced.

I'm getting an intermittant error:

(Inner Most Exception) System.Net.Sockets.SocketException:  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond x.x.x.x:80

(Middle Exception) System.Net.WebException: Unable to connect to the remote server

(Outer Exception) System.ServiceModel.EndpointNotFoundException:  Could not connect to http://<MYSite>/<MYApp>/<MYService>.svc. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond x.x.x.x:80.

I can reproduce this error with about 20% reliability if I execute the exact same page request on the client from 2 browsers at the same time.  When the problem occurs, the successful p

Team System: Customizing Work Items


Team Foundation Server's work iIem tracking system provides a number of advanced customization options.This article explores custom control support that lets you link to date, enhance the user experience, present data, and more.

Brian A. Randell

MSDN Magazine October 2009

Peer Fun: A Peer-To-Peer Work Processing App With WCF


We demonstrate creating a peer-to-peer processing platform where multiple players function together for a common purpose: getting your work done.

Matt Neely

MSDN Magazine June 2009

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