|
Hello,
I'm working on a project that I'm trying to export data from textboxes in asp.net website project to a powerpoint file. I writing ofcourse in C#.
The whole concept is to use the data the a user inserts to the text boxes and they are sent after clicking a OK button directly to a powerpoint file. I'm using OFFICE 2007 so I'm using powerpoint 2007 for this.
A similar concept that I'm already using in the website project is doing the same thing but exporting to a WORD format file. I bumped against this following site a software to perform this and it's called: SoftArtisans. There website is http://www.softartisans.com/ .
Now, if somebody has a clue or a tutorial how I can do this, Export to a powerpoint file I'll be very thankful.
I am also using Microsoft SQL Server 2008 R2 to save the data in the database, so if maybe someone knows how to export the data from the textboxes from the website TO the database and then TO the powerpoint file that could help to.
Thank you very much for your help and support.
modified on Friday, June 25, 2010 11:24 AM
|
|
|
|
|
|
I'm trying to export the data from textboxes in my website. I don't want to export the whole website or the whole page to a file. I have an templete file that in it I have some merge field that I want the data from the textboxes in the website to get exported to the merged fields.
that's it, thanks
|
|
|
|
|
You are going to have to write code to do that.
Office 2007 / 2010 uses the OpenXML format, so in order to
watchdogger wrote: export the data from textboxes in my website
You are going to need to manipulate the actual document yourself. You are going to have to read up on the OpenXML format and then write some code to accomplish your task.
If you don`t want to
watchdogger wrote: export the whole website or the whole page to a file
Then don`t code it that way.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Hello All,
I need to search recursive control inside gridview
i have written below code but i can not able to find the control in which are define in <asp:templatefield> I have taken on linkbutton inside templated field but when i try to search control but i didn't get.
Code :
public static Control FindControlRecursive(Control Root, string Id)
{
if (Root.ID == Id)
return Root;
foreach (Control Ctl in Root.Controls)
{
Control FoundCtl = FindControlRecursive(Ctl, Id);
if (FoundCtl != null)
return FoundCtl;
}
return null;
}
but it return null while i am try to find out control like
LinkButton B = FindControlRecursive(GridView1, "lnk") as LinkButton;
can you please help how to resolved above issue?
Thanks in advance,
Anish Patel
|
|
|
|
|
Hi! in future post, try using the code block just for better understanding of the code
Well, the Control, must be a GridView, so you can add
public static Control FindControlRecursive(Control Root, string Id)
{
if (Root.ID == Id)
return ((GridView)Root);
if (Root is GridView)
{
GridView gv = ((GridView)Root);
Int32 num = 3;
Int32 row = 1;
Control FoundCtl = ((Control)gv.Rows[row].Cells[num].FindControl(Id));
if (FoundCtl != null)
return FoundCtl;
}
return null;
}
Remember that in ASP.NET the dinamically controls added like in grid view Template field, have the same name, except in Client-Side. if you want a especific row, you only need to change the row parameter
|
|
|
|
|
I am new to web applications.
I wish to do an e-commerce site.
I wish to use ASP.NET , C#.Net and SQL Server.
What is front end and back end?
for a two tier application I think we say VB.NET as a front end and SQL Server as a back end
I think an e-commerce site is a three tier application
I preferred ASP.NET, C#.Net & SQl Server.
Which one of these are called as a front end and the backend?
|
|
|
|
|
|
When I click Button1, Button2 gets enabled and the label's text is set to "bye". This is done with a bit of javascript. When Button2 is clicked, it's text should be set to "bye" - the new text value of the label, but is set to "hello" instead - the original text value of the label. How can I fix this?
Aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<script type="text/javascript">
function Hello() {
document.getElementById('Button2').disabled = false;
document.getElementById('Label1').innerText = "bye";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="Button1" onclick="Hello()" />
<br />
<asp:Button ID="Button2" runat="server" Enabled="False" Text="Button2"
onclick="Button2_Click" />
<br />
<asp:Label runat="server" ID="Label1" Text="hello"></asp:Label>
</div>
</form>
</body>
</html>
Cs:
protected void Button2_Click(object sender, EventArgs e)
{
this.Button2.Text = this.Label1.Text;
}
|
|
|
|
|
Markup - HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<script type="text/javascript">
function Hello()
{
document.getElementById('Button2').disabled = false;
document.getElementById('Label1').innerText = "bye";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="Button1" onclick="Hello()" /><br />
<asp:Button ID="Button2" runat="server" Enabled="False" Text="Button2" /><br />
<asp:Label runat="server" ID="Label1" Text="hello" />
</div>
</form>
</body>
</html>
Code-behind
void Page_Init(object sender, EventArgs e)
{
Button2.Click += new EventHandler(Button2_Click);
}
protected void Page_Load(object sender, EventArgs e)
{
}
void Button2_Click(object sender, EventArgs e)
{
Button button = (Button)sender;
button.Text = "Something new";
}
|
|
|
|
|
I need to use the label's new text value in the code behind for further processing. Using 'this.label1.text' doesn't work as it gives the original text value not the new one.
|
|
|
|
|
Oops sorry. Can you not simply use the code-behind to solve this issue?
Because your clicking on a server control the page is reloaded back to its orginal state. If you want to change the text of the button after changing the label control using JavaScript then you will need to change the second button using JavaScript also.
|
|
|
|
|
No. I am working on an application that utilizes a scheduling control. This control has a client-side click event that I must use. When I click on the control it must set a property wich in turn must be used when a button on the page is clicked. My solution to this was to set a label's text property but that doesn't seem to work, as you have seen in my code. Maybe you can help me out. Thanks anyways.
|
|
|
|
|
Only other way I can think of is to use a hidden field.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<script type="text/javascript">
function Hello() {
var value = "bye";
document.getElementById("<%=Button2.ClientID %>").disabled = false;
document.getElementById("<%=Label1.ClientID %>").innerText = value;
document.getElementById("<%=hdnValue.ClientID %>").value = value;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="Button1" onclick="Hello()" /><br />
<asp:Button ID="Button2" runat="server" Enabled="False" Text="Button2" />
<br />
<asp:Label runat="server" ID="Label1" Text="hello" />
<asp:HiddenField ID="hdnValue" runat="server" />
</div>
</form>
</body>
</html>
void Page_Init(object sender, EventArgs e)
{
Button2.Click += new EventHandler(Button2_Click);
}
protected void Page_Load(object sender, EventArgs e)
{
}
void Button2_Click(object sender, EventArgs e)
{
Button button = (Button)sender;
button.Text = hdnValue.Value;
}
|
|
|
|
|
Thank you very much! It works!
|
|
|
|
|
When I click button 1, button 2 must be enabled and the label's text must change from "hello" to "bye". This must be done clientside through Javascript. How must I change the following code to get this to work? When I click button 1 the label's text changes but immediately reverts back to it's original value.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<script type="text/javascript">
function Hello() {
document.getElementById('Button2').disabled = false;
document.getElementById('Label1').innerText = "bye";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Hello()"/>
<br />
<asp:Button ID="Button2" runat="server" Enabled="False" Text="Button" />
<br />
<asp:Label runat="server" ID="Label1" Text="hello"></asp:Label>
</div>
</form>
</body>
</html>
|
|
|
|
|
When you click the button the client-side script is being executed properly, however, it also causes a post-back which resets the page. If all you need to do execute client-side script with no post-back then change the asp:button controls to simple html elements <input type=button>
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Or just put a
return false; in the Hello function.
That should also work.
..Go Green..
|
|
|
|
|
Only if he includes the "return.." part in the OnClientClick
also. Like:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<script type="text/javascript">
function Hello() {
document.getElementById('Button2').disabled = false;
document.getElementById('Label1').innerText = "bye";
return false;
} </script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return Hello()" />
<br />
<asp:Button ID="Button2" runat="server" Enabled="False" Text="Button" />
<br />
<asp:Label runat="server" ID="Label1" Text="hello"></asp:Label>
</div>
</form>
</body>
</html>
|
|
|
|
|
Could you perhaps explain the purpose of these return statements?
|
|
|
|
|
Returning a value in a javascript click event handler tells the browser whether or not to continue normal processing of that click. For a submit button, returning false tells it to stop processing a not to actually submit the form. Returning true allows it to continue submitting the form normally. For a hyperlink returning true would allow the browser to navigate to the URL and returning false would leave the user on the curernt page.
|
|
|
|
|
return statement is to avoid PostBack.
"When I click button 1 the label's text changes but immediately reverts back to it's original value."
this is because of PostBack
Raju.M
|
|
|
|
|
Yes. And that's what I said.
His Hello() function is called on OnClientClick. I missed the return in OnClientClick part.
I am sorry I didn't explain it.
..Go Green..
|
|
|
|
|
Hi..
I am revisiting codeproject after couple of days due to my old question.
I have done some coding in session_end in global.asx and want to execute this event , if someone closes the browser window.
I just want to have alternative to authentication.
thanks,
By:
Hemant Thaker
modified on Friday, June 25, 2010 8:17 AM
|
|
|
|
|
I believe someone posted an article or tip/trick regarding this a few days ago though can't find it now. Try searching through recent articles.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|