.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

Get all the tag in a webpage.

Posted By:      Posted Date: September 19, 2010    Points: 0   Category :.NET Framework
I want you help me how to program in c# to get all th <img src=""> tag in a webpage.

Please help.

Thanks and more power.

View Complete Post

More Related Resource Links

Custom views on .aspx webpage


Hi again, i have a client that needs me to create a custom view on thier webpage similar to Microsoft Word.

It goes about that, when I click on an image it redirects me to another page and must create a custom view for a certain paragraph on that page. I am not sure how to do this and wonder if anyone knows how.

I am using C# programming language if that helps at all. I Heard that using javascript would work but i dont know javascript yet so is there any alternative?

Setting webpage/masterpage background...image?


I want to have the background of my masterpage (the master page for all of my .aspx pages) have a sort of gradient.  I imagine the only way I can do that is with an image.  Or maybe even some other design, but I want to move away from the "solid color" background.

Is the easiest way to do this just to make an image and set that as the background?  What image size should I make it, because some users could possibly have the normal aspect ratio, or maybe a widescreen?  What should I make it like so that it looks good on all computers?

Thanks in advance. :) 

Autoscroll down to a specific line on the webpage



I wonder about how this autoscroll is working on a page. For example when entering a page that I have set up named "test.aspx",

I want to 'autoscroll' down to a specific textrow that I have so that textrow exactly will be on the very top of the browser window.


I wonder how you do this task? Thanks! 

Cannot open a webpage during testing


I've been tearing my hair out over this one for the past couple of days...

I am using VS2008 & IIS7 with Windows 7 & IE8. I am debugging locally.

On a certain situation on my screen, VS cannot postback a page. I am getting the following error and have tried everything I can think of to resolve the issue, but to no avail.... I have used local IIS and also just the internal web server as well.

Unable to download pagename.aspx from localhost.

Unable to open this Internet site. The requested site is either unavailable or cannot be found.

Please try again later.

Somebody had to run into this before... Can someone please help????

How to Get the Title, Description Property of a WebPage

Hi Guys! I'm doing up a search engine & what i want to happen is to get the title and description from the page as in below:<%@ Page Title="WHSCT - Health Care Management Plans" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="healthcare.aspx.vb" Inherits="mainpage" Description="List of care plans under Gynaecology, Obstetrics, NNICU & Paediatrics" %> And here is the code that gets the meta tags:Public Shared Sub GetFileInfo(ByVal FPath As String, ByVal srchFile As Page) Dim fileInform As New FileInfo(FPath) Dim strBldFile As New StringBuilder() Dim fileSize As Decimal = fileInform.Length \ 1024 srchFile.Size = fileSize GetFilePath(FPath, srchFile) If InStr(1, ClassSite.DynamicFilesTypesToSearch, fileInform.Extension, vbTextCompare) > 0 Then m_page.Trace.Warn("Path", String.Format("{0}/{1}", "", srchFile.Path)) GetDynamicFileContent(srchFile) Else GetStaticFileContent(FPath, srchFile) End If If Not srchFile.Contents.Equals("") Then 'Read in the title of the file 'Path.GetFileName(FPath).Substring(0, Path.GetFileName(FPath).LastIndexOf(".")) s

IE cannot display the webpage during report execution

Hi. I have a problem with a report having some T-SQL and MDX queries. When I execute it during the working hours I have an error about that Internet Explorer cannot display the web page, but in the other hours the execution is completed successfully. I have a look inside RS log but I cannot find any errors; no timeout is set about report execution inside the Report Manager. Any ideas to solve this issue, please? Many thanks

Silverlight gives the error "Internet Explorer cannot display the webpage"

Hello, I'm new to SharePoint 2010.  I have an SP2010 environment up and running.  When I click on a link that activates Silverlight, I get an error that reads "Internet Explorer cannot display the webpage".  The Server is on a different domain. When I use remote desktop to access the server, I can open up the same link using IE and I can see the content no problem. An example would be from the calendar page.  If I choose a date and select 'add', the browser fades and I see a 'loading' screen.  Then the next screen I get the error.  If I follow the same process on the server using remote desktop, everything works. What could the problem be?

Image copy/Paste on a asp.net webpage

  Hi All,            I need a help, in my project I have a requirement, which is I have to copy image from MS-Word and paste it on webpage directly. So that copied image should be display on webpage and save into server automatically. It can be possible using windows applications., but now the same functionality has to implement in asp.net web applications. Any help much appreciated. J Hint:  using javascript Clipboard functionality we may achieve it, but could get correct solution for this . :( Thanks, Naidu 

RegEx Request : Get all the tag in a webpage.

Hi! I have used Regular Expression(?<=img\s+src\=[\x27\x22])(?<Url>[^\x27\x22]*)(?=[\x27\x22]) to get about content of src tag.  For this case:    - Example: <img src="/vasep/Data/Sites/1/picture002.jpg" alt="hhhh" title="hhhhh" width="550" height="412" />        Regular Expression is true. I get content of src tag. But!! For this case:  -  Exmple: <img title="hhhhh" src="/vasep/Data/Sites/1/picture002.jpg" alt="hhhh"  width="550" height="412" />      Regular Expression is false. I do not get content of src tag.Please help me!

"Internet Explorer cannot display the webpage" from IE7 - ASP.NET Development Server Error?

Dear everybody, I've just installed Microsoft Visual Studio 2008 on Windows Vista Ultimate. I created "New Web Site" and Started Debugging the page to see the blank page rendered. To my surprise, IE 7.0 displayed an error message saying: "Internet Explorer cannot display the webpage". I spent some time investigating and here is the result: The page going to be rendered assumes port 49791: http://localhost:49791/WebSite3/Default.aspx The ASP.NET Development Server operates under different port no: 49793 After changing the url above manually to use the port of ASP.NET Development Server, the webpage gets renderred correctly: http://localhost:49793/WebSite3/Default.aspx ASP.NET Development Server uses dynamic ports. I noticed that Debugging process always assumes port number lower by 2 than the real port number of the ASP.NET DevSer. Therefore Debug process never runs and displays the page. I do not want to manually edit the local host URL after every page rebuild, so my question is following: How to make the "Start Debugging" function to use appropriate port of the ASP.NET Development server? How to make Visual Studio to open the page being debugged? To mention couple of things I tried: I reinstalled Visual Studio2008, tried to disabled IPv6 as some threads recommen

What is the best way to communicate back and forth from a ASP.Net webpage and a WPF application?

As the title suggests, I need to pass some values back to local wpf application every time  a specific link is clicked on an asp.net webpage.   I had an idea to use WCF with the webpage and the application to be clients of the wcf service and pass values that way... but i wanted to make sure there wasn't a better or easier way to do this.

Changes in the values of controls of .cs file not reflecting on .aspx webpage while execution.

In my code I am assigning certain values to labels from data reader.While debugging I can see that proper values are assigned but the changes are not reflecting in the end of debug on the webpage that are executing.// My Code// Question.aspx.csusing System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;public partial class Examinee_Question : System.Web.UI.Page{    ExamFunctions ef = new ExamFunctions();    SqlConnection con,con1;    SqlCommand cmd,cmd1;    SqlDataReader dr,dr1;    String QType="";    int ctr = 1;    protected void Page_Init(object sender, EventArgs e)    {        con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Db.mdf;Integrated Security=True;User Instance=True");        con.Open();        con1 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Db.mdf;Integrated Security=True;User Instance=True&qu

Working Webpage at log off state of the web server

Hi,There is a possibility that the web server computer (host) resets and there is nobody that can log in to system after reseting . I dont want my webpage stop working at this state until the Admin login to the server. so I want my webpage do its main job at logoff state of the server.how can I create this webpage? what technology can I use to do this? Regards

Opening a webpage impersonating the user

Hi, I have to do something quite weird.I have a WebApplication1 running in a port (let's say 4000) and I'm trying to build a website (WebSite1), running on IIS, that is running on the same server. I have no control over the WebApplication1, it's a packaged software, WebSite1 is built by me.The WebSite1 will do a custom user validation and then will let the user access the WebApplication1:4000 under the impersonated user under which the website is running, not the user in the client machine. Sort of like changing the user in the session.I know this makes very little sense (unless you're in my situation) just want to know if this is remotely possible.Thanks a ton,Regards

by using a javascript how should i open a webpage???

in my webpage link button is there by clicking that i should open a webpage....i want by using javascript function{DoPostBack()}help me in this????

Is it possible to use a webpage form in the workflow process instead of using a document?

We need to move our current IT work request form to sharepoint workflows.  The reason for this is because we need to be able to have an approval process for non-managers who fill out the IT work request form and then submit.  How do I get started adding a webpage to the approval process in workflows?  I'd like it to work exactly how adding a document, from the document library.  If it is possible, can someone direct me to a tutorial out there or give me some insight? Thanks, Shawn

How to make sure that user doesn't open same webpage in two different browsers or browser tabs?



We are using asp.net StateServer for asp.net session management. In our project we need to make sure that if a user is already logged in and if he is trying to acess the website from a different browser tab, we need to inform him that he is already logged in in another tab and use it instead of opening a new session. Consider the following scenarios:

1. User is logged on in tab1 and his session is still on, then user tries to logon from another tab, the browser sends the asp.net session_id cookie, In the page init i am checking if the Asp.net session Id cookie is present, if it is there i am checking if the it is a new Session (i.e. if the existing session timed out), if it is a new session then proceed with the user action else it means that the session in tab1 is still active so i am redirecting user to error page with appropriate message.

Now the problem with this approach is that, suppose session in tab1 is expired and user opens tab2 and performs some actions, now he goes back to tab1 and perform any action, i directly need to take him to log out page.

Please let me know how this can be achieved.

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