473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to get div tag values from innerHtmlText? in C#

My Question is .
Expand|Select|Wrap|Line Numbers
  1. String varText ="<div>
  2. <h3> Title </h3>
  3. <p>body text details </p>
  4. Venue : india  Time : 12:10:10 am
  5. </div>";
  6.  
  7.  
  8. Now I need to do here extracting values and store on diffrent variable
  9. from "varText" data extract as a below format!
  10. String Title = <h3> Title </h3>
  11. String body = <p>body text details </p>
  12. String venue = Venue : india  
  13. String Time = Time : 12:10:10 am
Any body help me!
Thanks in Adv
Haque
<email removed for your own protection>
Nov 12 '08 #1
1 7850
Frinavale
9,735 Expert Mod 8TB
Instead of shoving everything into one String variable as you are doing here:
Expand|Select|Wrap|Line Numbers
  1. String varText ="<div>
  2. <h3> Title </h3>
  3. <p>body text details </p>
  4. Venue : india  Time : 12:10:10 am
  5. </div>";
Spit it up into 3 Strings....as you are doing here:
Expand|Select|Wrap|Line Numbers
  1. String Title = "Title";
  2. String body = "body text details";
  3. String venue = "India";
  4. String Time = DateTime.Now();
Add some Labels to your ASPX page and set their styles so that they are the way you want them to:

Eg:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head runat="server">
  5.     <title>Untitled Page</title>
  6. </head>
  7. <body style="background:White;">
  8.     <form id="form1" runat="server"> 
  9.            <h3><asp:Label ID="myTitleLabel" runat="server"></asp:Label></h3>
  10.            <div>
  11.               <asp:Label ID="myBodyLabel" runat="server"></asp:Label><br />
  12.               <asp:Label ID="myVenueLabel" runat="server"></asp:Label><br />
  13.               <asp:Label ID="myTimeLabel" runat="server"></asp:Label><br />
  14.            </div>
  15.     </form>
  16. </body>
  17. </html>
  18.  
Then set your the text in the labels:

Expand|Select|Wrap|Line Numbers
  1. myTitleLabel.Text=Title;
  2. myBodyLabel.Text=Body;
  3. myVenueLabel=Venue;
  4. myTimeLabel=Time;
  5.  
Now you have no nned to extract the innerHtmlText...you just grab the Strings out of the Labels' Text property.

Although I have no idea what you are trying to do...
Nov 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Paul C-T | last post by:
Hi, Am I trying to be too clever here? I am trying to write a PHP page to enable me to enter values into a form then write those values to a text file. I want to use the form & table that...
66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
1
by: Sue Adams | last post by:
I have a form on an asp page and am trying to write the code to place the values of all checkboxes that have been selected, into an array. The checkbox values will be used in a dynamic sql statement...
4
by: Steve Hall | last post by:
Folks, My secnario involves two tables - ObservationRegister, and Person. ObservationRegister contains most of the "useful" fields, including the UserID of the person that raised the record, and...
6
by: cipher | last post by:
I have some constant values in my web service that my client application will require. Having to keep server side and client side definitions insync is tedious. I am trying to do something like...
2
by: Hennie | last post by:
I apologise if this is a stupid question, but I would appreciated any help on this subject. I want to create a view (VIEW_1 in example below) where I take numeric values from a field in one...
8
by: aleksandar.ristovski | last post by:
Hello all, I have been thinking about a possible extension to C/C++ syntax. The current syntax allows declaring a function that returns a value: int foo(); however, if I were to return...
13
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! With VALUES you can do something like: SELECT * FROM (VALUES ('A', 1), ('B', 2), ('C', 2)) AS TEMP(LETTER, NUMBER) which will give you: LETTER NUMBER ------ ------ A 1 B 2...
8
by: gigonomics | last post by:
Hi all, I hope someone can help me out. I need to return the best available seats subject to the constraint that the seats are side by side (or return X consecutive records from a table column...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.