.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 Do I Extract Particular Text From Web Page?

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :.NET Framework

How can I extract the gmail address out of the following html example?:


How would I extract the EMAILTOEXTRACT@GMAIL.COM and send it to a Textbox1.text using Regular Expressions? It will be extracted from the webbrowser1 and then sent to the Textbox1.text.

Any help would be appreciated.

View Complete Post

More Related Resource Links

reference from menubuttons to text parts in article on the same page


Hi, I'm searching now for hours but couldn't find it.Cry

In my menu i have several buttons which (by a <a href..) should go the a part of an article that is in the same form.

Menu button : What is a database should go to the page default.aspx and in there is an article published.
A part of this article is having a piece of text about "what is a database"

Menu button: how to make a query should go to this same article in the same page but then to the part that is have the piece about the query. The next could be an example of what i'm doing:

    <li><a href="default.aspx ?????>what is a database</a></li>
    <li><a href="default.aspx ?????>what is a query</a></li>

Where my question marks are, there should be a connection to that particular piece of text.
In each article part there is an ID="text1" and the second part id="text2"

How shoudl i do that, Should i use a question mark.
Please give me some guidance how to structure the <li> statement or a pointer where I can read about it.


allow client to modify text on web page


I have been trying to find out how I can allow a user to modify/update a page/pages on a web site. I understand there has to be site security with authentication and authorisation but what is there as a user interface for them easily to update a page? 

Thanks for any pointers.

Why does text and page formating changes randomly?

Hallo there, First of all I don't know if I am posting in the right forum, so let me know if there is another forum for this issue. My form text and entire page formating changes once a while and I don't know why. e.g. font color, background color of certain paragraphs or table look changes, it seems randomly, I think it has something to do with the style but I don't know how to avoid this repeated text formating loses. In details: U am using Visual Studio 2010 Professional and is set for Visual Web Development. I create a new form e.g. default.aspx link it to a master page and the master page is linked to a css file (style sheet file) that contains only general and basic formatings and I hardly change any thing in this css file. I format my default.aspx. and later the formating chanegs by it self and I have to change it back manualy. Most of the time I have to create a new form. link it to the master page and copy the text, tables and so on from the original page to the new page and then delete the original page. but even the new page chnages later. and so on. I don't know how to avoid that! Any idea's? Thanks in advance  Michael Najar wishes you great day

Extract text from html source code

i wan to extract Desired Title,Desired Text and Desired link from Webpage source code and paste in richTextBox1. <a href="/site/show/link/0/type/0">Desired Titl e</a> <a title="&lt;b&gt;Text preview&lt;/b&gt; &lt;br/&gt;Some Text" class="pdtip" href="/site/show/link/0/type/0">Text</a><br />Desired text <br /> <label class="url" for="">http://Desiredlink.com </label> Output: Desired Title Desired Title Desired link How can i do this?

Change label text on master page from the content page.

Hello. Can I access the objects (for example change the label text) on the master page, from its contents page code? If yes, how can I approach that? Thank you Artashes

Consistently running out of page file memory with full text indexer

Using MS SQL Server 2008 SP1 x64 Standard Edtion on Windows 2008 R2 Enterprise, I'm about to full-text index for the first time 1 table and 2 views. The table contains about 250'000 entries with a data space of 180 MB. As soon as I activate the full text indexing, the fdhost.exe task starts to consume slowly but surely all the available page file space (this can be easily watched using the Resource Monitor and the Commit Charge graph on the memory tab). Once all the virtual memory has been consumed, the server becomes unusable since it can't open any new windows any more, and RDP stops working. The machine specs are as follows: 12 GB of RAM 80 GB free on hard disk out of 136 GB 8 CPUs Custom size paging file with sizes between 24 GB - 60 GB (originally, this was system managed size, but then the server ran out of memory sooner) Max SQL server memory set to 6 GB (first 10 GB, then 8 GB) I've set the max fulltext crawl range to 8. During the indexing, the 8 CPUs are bit busy for a while, but not excessively. What is astonishing is that there is almost no use of physical memory during the indexing (I can see an increase from 2 GB to 3 GB which still leaves plenty of RAM available). Does anybody have an idea how I can convince fdhost.exe to consume physical memory and leave the paging memory alone? Or what else can I try?

Read a text file on another server from a web page

How do I read/write a text file on another server from a web page. I get the error "Access to the path '//Server2/mydatafiles/test.txt' is denied". I do not get the error if I am running the browser on the server where the files exist. I think I need to set permissions on the destination server in some way.   Can you help? Thanks  

Problem passing a text box value from aspx.cs page to SelectParameters in aspx page

Hi,I would like to take a value from a text box and pass it as a search parameter to my database. I get the value from my code behind page as follows: protected void btn_click(Object sender, ImageClickEventArgs e)      {           AccessDataSource1.SelectParameters["inputValue"].DefaultValue = TextBox1.Text;           string test = AccessDataSource1.SelectParameters["inputValue"].DefaultValue;                      //string inputValue = TextBox1.Text;          //Response.Write(inputValue);         // AccessDataSource1.SelectParameters.Add("@name", inputValue);          //Response.Write(@inputValue);                              } protected void btn_click(Object sender, ImageClickEventArgs e)     {          AccessDataSource1.SelectParameters["inputValue"].DefaultValue = TextBox1.Text;          //An alternate option I have used is          //string inputValue = TextBox1.Text;         // AccessDataSource1.Selec

extract page view to library

i have a infopath form, within this form there 10 view availeble. a few pages is just for entering a company details and some extra data like meeting request, intervention, ... than there are some page just for a travel request: on a meeting or intervention these are different pages because some extra data is needed. those pages have a button that saves the document and send the form to a different form library. now the whole form is transported to the new library. is it possible that i can export ownly the travel view page, to the new form library?   regards  

extract date from text string - Transact-SQL

Hello, I have a field in my database with an archived date... (Giampaoli  Live Oak, Almonds Archive 09/16/10) I need to be able to extract the date from this, then perform a datepart function on it... How do I extract the date into it's own value using just SQL? Thanks, Wes

Render XML text *inside* of an ASP.net page?


I have a block of XML text I need to show the user (so they can copy/paste the XML from the screen)

I use StringWriter() to make the XML a String but when I use Response.Write(xmlString) I get the following error

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '<?xml version="1.0" '.

I guess IE does not like rendering XML in the middle of a page?

is there anyway to show the XML data in the middle of my ASPX page?

Many thanks! :)

Page Layout and Text Layout Buttons Disabled on Ribbon

I am trying to create a publish site in Sharepoint 2010, and I am using the Ribbon control.  Currently, I am having trouble adding and changing content on my site, due to both the Page Layout and Text Layout buttons being disabled.  I have been trying to figure out what security or feature needs to be active to get these enabled again.  Any help would be appreciated.

how to find any text in current page with java script like (CTRL + F) ie or firefox .



i have a page with datalist and more label

and i have an input text and a html button in my page.

i need a javaScript code for find text in my page like ( ctrl + f ) in ie or firefox . ?!


Dynamically added text boxes disappears after page refresh


Dim objDatabase As New database
        Dim objAdapter As SqlDataAdapter
        Dim objDataset As New DataSet
        Dim objAdapter1 As SqlDataAdapter
        Dim objDataset1 As New DataSet
        Dim objAdapter2 As SqlDataAdapter
        Dim objDataset2 As New DataSet

        objAdapter = New SqlDataAdapter("SELECT first_name + ' ' + last_name as [Name],father_mobile_no as [Father Mob No],mother_mobile_no as [Mother Mob No] FROM student_data WHERE class='" & cmb_class.SelectedValue & "' and division = '" & cmb_division.SelectedValue & "' and school_id='" & Session("school_id") & "'", objDatabase.con)
        objAdapter.Fill(objDataset, 0)
        If objDataset.Tables(0).Rows.Count > 0 Then

            Dim dt_table As DataTable

Printing to printer. Not the page but some specific text.



I do run System.net.Mail on my web pages to send email confirmations. For those who doesn´t have an email I would like to print the letter to a printer.

Below is my code to send a body to the email. It works great. How ever. Could I somehow add a function to my page so when customer has no email the page instead prints the code to our network printer?

Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString("    <center> <img src=cid:companylogo> </center><br><br> " & fornamn & " " & efternamn & " " & "<br><br> " & adressen & "<br><br> " & "" & postnummer & " " & "" & postorten & "<br><br><p><strong>Välkommen som medlem i XXXX! </strong></p><p><strong>Tack för din beställning!", System.Text.Encoding.UTF8, "text/html")

Correct Way to Insert Data from Text Boxes on ASPX page into SQL Database Using VB


Please help me, I have been trying this for a week now and this is how far I have gotten.


I am new to this, and I am using MS Visual Web Developer Express.


OK - This is what I have come up with, but when I run it I get the following error  (I decided to just try to use a simplified table just to get an understanding of the basic concepts):



Partial Class label_form
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Declaring variables
        Dim username, labelname, ownersname, address1, address2, city, state, zipcode, country, contactnumber, emailaddress, data_source, con, sql_insert

        ' Check if Necessary Text Is Missing ( will do this once I can get it to work with no empty text boxes)

        ' Get Values from TextBoxes
        username = txtUserName.Text
        labelname = txtLabelName.Text
        ownersname = txtOwnersName

SSIS Error Text was truncated or one or more characters had no match in the target code page


I the same issue or something close.

Except I have one Field (27) that get a trunacation error


Data conversion failed. The data conversion for column "Column 27" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

The "output column "Column 27" (91)" failed because truncation occurred, and the truncation row disposition on "output column "Column 27" (91)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.


Data looks like:Red Text is the field that is throwing the error!





"RUTH           ",

"EDWARDS             ",









"1447203880    ",


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