Click here to Skip to main content
15,173,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a single page load event in multiple asp .net CS files in the following manner
protected void Page_Load(object sender, EventArgs e)
            if (CheckLoginStatus.Check(this))
                VisitorSection.InnerHtml = "";
                MemberSection.InnerHtml = "";

Now I want to replace the following line

VisitorSection.InnerHtml = "";

With these two lines

VisitorSection.InnerHtml = "";
WelcomeName.InnerText = Session["UserName"].ToString();

As you might know that find and replace option only allows single line to be replaced, how can I deal with above scenario?

Thanks in Advance for help..

1 solution

Tricky question - Regular expressions is the answer:

Press Ctrl+Shift+F
Enter 'VisitorSection.InnerHtml = "";' in 'find what'
Eneter 'VisitorSection.InnerHtml = "";\nWelcomeName.InnerText = Session["UserName"].ToString();' in 'Replace with'
Go to Find options-->Tick Use-->Select Regular expressions

'\n' is used to seperate lines

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900