|
Hi all,
I am developing a CMS using asp.net 2.0 and c# 2.0.
I have a html template file...
with the following text in the file.
{=BeginCatRecords=}<TABLE><TR><TD colspan='2'>Links comes here</TD></TR></TABLE>{=EndCatRecords=}
I am reading this file in a variable let say st.
Now, I want to find the text from {=BeginCatRecords=} to {=EndCatRecords=}
I am using this code :
string pattern = @"{=BeginCatRecords=}.*?{=EndCatRecords=}";
Match MatchTop = Regex.Match(st, pattern);
string NavMatch = MatchTop.ToString();
It is working fine when I write the html in one line (as displayed above) in my html template file..
But when I change it to multiple line as :
{=BeginCatRecords=}
<TABLE>
<TR>
<TD colspan='2'>Links comes here</TD>
</TR>
</TABLE>
{=EndCatRecords=}
It doesn't work.
Can you please let me know how should I change the pattern to meet the requirement....
Thank you in advance..
Suman Singh
|
|
|
|
|
There's an option you pass in to an overloaded method of the match function to make the regex run on multiple lines
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Have you tried:
Regex.Match(string1,string2, RegexOptions.Multiline)
|
|
|
|
|
Many Thanks for your reply.
I tried your suggestion but no avail...
Here is the HTML code from a file (categories.html), I a reading in a variable st :
<br />
<TABLE width="100%" border="0" align="center" cellpadding="0" cellSpacing=0 >
<TR valign="top" >
{=BeginCatRecords=}<TD width="45%" align='center' style='border:1px #F4EED4 solid;'><Table align='center' border="0"><tr><td align='center' style="padding-top:15px;"><a href="{=CatLink=}"><IMG SRC="images/category/{=CatImg=}" border="0" width="150"></a><BR><a href="{=CatLink=}" class='catlinks'><strong>{=CatName=}</a></strong></td></tr><tr><td><table width="90%" border='0' align="center" cellpadding="0" cellSpacing=0><tr><td align='left'>{=CatDesc=}</td></tr></table></td></tr></table></td><td width='5%'> </td>{=EndCatRecords=}
</TR>
<TR><TD colspan='2'> </TD></TR>
</TABLE>
In this file, from {=BeginCatRecords=} to {=EndCatRecords=} is written in one line.. and it is working fine...
But if I split it in multiline like :
{=BeginCatRecords=}
<TD width="45%" align='center' style='border:1px #F4EED4 solid;'>
<Table align='center' border="0">
<tr><td align='center' style="padding-top:15px;"><a href="{=CatLink=}"><IMG SRC="images/category/{=CatImg=}" border="0" width="150"></a><BR><a href="{=CatLink=}" class='catlinks'><strong>{=CatName=}</a></strong></td></tr><tr><td><table width="90%" border='0' align="center" cellpadding="0" cellSpacing=0><tr><td align='left'>{=CatDesc=}</td></tr></table></td></tr></table></td><td width='5%'> </td>
{=EndCatRecords=}
It stops working...
Below is the code I am using to match the string :
string NavMatch = null;
pattern = @"{=BeginCatRecords=}.*?{=EndCatRecords=}";
Match MatchTop = Regex.Match(st, pattern, RegexOptions.Multiline);
NavMatch = MatchTop.ToString();
Please help..
Suman Singh
|
|
|
|
|
Hi..Iam using Visual studio 2003.
I have a Signup webform which has many text boxes.These text boxes are validated using validation controls.So if some one didn't enter proper values and click the sign up Button control the Validation controls will prevent the Button Click Event Handler method from being executed and will display error messages using a validation summary control.The form is working fine locally(on my PC) but when I upload the page and the dll file for the application(as always) to the Web Server the Validation controls dont work.
What could prevent the Validation controls from working on the internet?
I am too late but i will never give up
|
|
|
|
|
I have run into cases where validators do not work on a server. If you cant change the server settings, you can simply disable client side validation. The validators will work on the server side.
|
|
|
|
|
Could this let the postback event to be fired? because I prefer that no postback events occur.
I am too late but i will never give up
|
|
|
|
|
A "postback" will occur, but the user will never know it happened. The screen will look like it never posted back.
|
|
|
|
|
hi,
how to use activex plugin in asp.net
if anybody have idea plz give me informaion how to bind data to that plugin
Thanking you
Bala
|
|
|
|
|
Hi
what will be the connection string for oracle and ms-access (both databases are located on remote pc)
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Obviously this site[^] has the answer that you need.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
I have searched this site but couldn't get the connection string for remote connectivity.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
What do you mean by remote connectivity?
All those connection strings work for both local and remote servers.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
They work for both local and remote servers.
|
|
|
|
|
HI
Guys in my application, the following excption is arising :
System.Web System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
I know this exception is because my application have reached the maximum connection pool size, what can be the possible reasons, and how to fix it, plzz reply ASAP,Thankx in advance.
|
|
|
|
|
The reason is most likely that you don't close the connections that you use, or don't close the data readers.
---
b { font-weight: normal; }
|
|
|
|
|
Well i have closed the connections and the data readers, what can be any other reason for it, If i increas the Max pool Size in Connection string what are its effects, plzzzzz reply ASAP,Thankx.
|
|
|
|
|
Normally you should never need to increase the pool size. I think that it is set at 100 by default, and you would need quite a lot of traffic to use that many connections.
Unless you have something like hundreds of page requests per second, your application is leaking connections somewhere.
---
b { font-weight: normal; }
|
|
|
|
|
Have you explicitly set the pool size? If yes, please check and set appropriatly.
you might like to use using(){} block for connection and datareader to use your connection and readet objects. That will take care of closing your connections accordingly.
- ashish
|
|
|
|
|
if it application window open or else close thats not cosider. i wanna every 15 min automatically update the database please give me sample coding
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
You can't do that with a web page. A web page needs a request to run, it can't be scheduled.
If you are using MS SQL Server, you can use the scheduler in the database to run a stored procedure every fifteen minutes.
Otherwise you will have to write a program that either handles the scheduling itself, or is run using the windows scheduler.
---
b { font-weight: normal; }
|
|
|
|
|
thanks
i will do web page itself.could u send me sample coding
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
Hi,
I am getting one error regarding viewstate when i redirect the page. in the second page i am getting the below error. i have enabled viewstate in the second page. And just i am redirecting from first page not i am doing anything in the second page even i am not placed single control. The error is given like below mentioned
"The viewstate is invalid for this page and might be corrupted. "
Thanks in advance...
Thanks and Regards
Venkat
|
|
|
|
|
When you access the Server.transfer("Pagename","true") utility in an aspx page, you will get the following error.
The View State is invalid for this page and might be corrupted
Thanks and regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Hi,
Thanks for your suggestion. But here i am not using server.transfer. I will give my code.
document.formname.method="post"
document.formname.action="secondpage path"
document.formname.submit()
that is my code. so the same error it is giving in second page
Can you please suggest me the solution
Thanks in advance
Thanks and Regards
Venkat
|
|
|
|