Click here to Skip to main content
15,904,934 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Html template
XML
<div id="dvFirstDiv" style="display: none;">
SOme text in the first div
</div>

 <div id="dvSecondDiv" style="display: none;">
            Second Div
 </div>


I have aspx page having two button btnfirst and btnSecond

I want that on click of button content of the first div which is in HTML template send to the customer and on click of the second button btnSecond
second div content "dvSecondDiv" will be send to the customer .


Both the div are in the same HTML template in the same folder where the project exist

[edit]Code block fixed[/edit]
Posted
Updated 31-Jul-13 23:37pm
v2
Comments
What have you tried? Where is the problem exactly?

1 solution

use runat="server" in the div element.

XML
<div id="dvFirstDiv" runat="server" style="display: none;>
     SOme text in the first div
<div>>


You can access this div id in the code behind file to take the inner html of the Div Element.

C#
string innerText = dvFirstDiv.InnerText;
string InnerHtml = dvFirstDiv.InnerHtml;


I hope this is what you are pointing out. If it is not I am sorry.
 
Share this answer
 
Comments
lalitkr 1-Aug-13 6:29am    
Getting message that current dvFirstDiv does not exist in the current context
and one thing that this part of the code

<div id="dvFirstDiv" runat="server" style="display: none;>
SOme text in the first div
<div>>

i am using in the html page suppose abc.html , so how can i call the same in the code behind this div id and send to the customer at the call of my button event
Thomas ktg 1-Aug-13 6:41am    
You mean that you want to read the text from another html file apart from the current .aspx page?
lalitkr 2-Aug-13 0:04am    
Yes excatly

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