|
|
hello friends,
I want to change the property of div dynamically such as depending on the condition sometimes its display to block or none;
Plz help me how to do this from codebehind...
Deepak Nigam
|
|
|
|
|
Hi,
You can declare div tag as Server control using runat attribute of div tag then only you can access it from codebehind
To block div tag use this code in codebehind
divId.Style.Add("display","block")
Cheers..!
Vijay s
|
|
|
|
|
Hi,
Can any one tell me how to download the open office document from an ASP.Net Applica1tion?
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi,
Which are the different and efficient way to show PPT files in ASP.net webpages. The page should works on all browsers and platforms.
Our requirement is like this,
1. User will upload a PPT file
2. Other users can view this slide only through webpage.
3. User should not download this file
4. page should works on all browsers(latest versions) and platforms
|
|
|
|
|
Did you try Zoho Show?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Thnaks for your response. To use ZOHO show we need to create presentations using this application . In our case the users are creataing application using Microsoft Power Point . ZOHO is not free for commercial use .
|
|
|
|
|
Hello,
<asp:gridview>
...
>
<columns>
<asp:templatefield headertext="Price" itemstyle-cssclass="cartPrice" headerstyle-cssclass="cartRowHeader">
<itemtemplate>
<asp:label runat="server" text=""><![CDATA[<%# String.Format("{0:c}",Eval("Price")) %>]]>' />
</asp:label></itemtemplate>
</asp:templatefield>
<asp:templatefield showheader="false" itemstyle-cssclass="cartTimes">
<itemtemplate>
<asp:label runat="server" text="x" />
</itemtemplate>
</asp:templatefield>
...
Actually it is a shopping cart. Pictorial representation is
Item Price Qty Total
1 2 1 $2
subtotal $2
"Your creditcard will be charged on shipping: $2"
I need to place a message as below:
Your creditcard will be charged on shipping: $2.
Now the length is to big so it distorts the grid view any idea?
Regards,
Pavas
|
|
|
|
|
Hi,
The trick sits inside ItemRowDataBound.
If this is my GridView definition, with 3 columns:
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound" ShowFooter="true" ..... >
Then my function looks like this:
public void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells.RemoveAt(2);
e.Row.Cells.RemoveAt(1);
e.Row.Cells[0].ColumnSpan = 3;
e.Row.Cells[0].Text = "Total creditcard is 5 dollar";
}
}
So first I check if we are in the footer, then I start deleting the cell I don't want, and then I span the first cell over the whole width, and sets its text.
Hope this helps.
|
|
|
|
|
When the page loads, the datareader fills in the textboxes with data.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Conn.Open()
Dim strSQL As String = "SELECT tblNieuws.ID, tblNieuws.Titel, tblNieuws.Inhoud, tblGebruikers.Naam, tblNieuws.Datum FROM tblGebruikers INNER JOIN tblNieuws ON tblGebruikers.GebruikerID = tblNieuws.GebruikerID WHERE ID='" & Session("ID") & "'"
Dim cmdLogin As New System.Data.SqlClient.SqlCommand(strSQL, Conn)
Dim reader As System.Data.SqlClient.SqlDataReader
reader = cmdLogin.ExecuteReader()
While reader.Read()
berichtid = reader.GetValue(0)
txtTitel.Text = reader.GetValue(1)
txtBericht.Text = reader.GetValue(2)
DropDownList1.SelectedValue = reader.GetValue(3)
txtdatum.Text = reader.GetValue(4)
End While
reader.Close()
Conn.Close()
End Sub
When the data is filled in by the reader, the textboxes can be altered by the user.
But for some reason, when the button is clicked after the new user input is filled in, the .text of the textboxes is still outputting the data from the reader instead of the user input.
Protected Sub btnverzenden_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnverzenden.Click
Dim strtitel As String = txtTitel.Text
Dim strbericht As String = txtBericht.Text
Dim strdatum As String = txtdatum.Text
...
I don't know what the problem is.
Thanks for any help!
|
|
|
|
|
hey what you need to do is in the Page_Load add an "if block"
if (!Page.IsPostBack)
{
put page load code here
}
this will check to make sure the page is loading for the first time or not essentially.
what's happening is when the button is pushed the page "reloads" because of the post back and then it runs that code again and replaces the fields.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I knew the solution was going to be really simple! Thank you!
Now I have another little problem though:
While reader.Read()
berichtid = reader.GetValue(0)
txtTitel.Text = reader.GetValue(1)
txtBericht.Text = reader.GetValue(2)
DropDownList1.SelectedValue = reader.GetValue(3)
txtdatum.Text = reader.GetValue(4)
End While
reader.GetValue(0) isn't producing any output, while it should be
giving the ID of the selected row in the table.
The others are producing good outputs though.
Can you help me with this? Thank you again =)
|
|
|
|
|
reader[0].ToString()
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
I have a gridview populating records at runtime,want to add a empty new row on click of a button(but the button is outside the grid) and the newly created rows with values should be saved in db
If you could send me a sample code abt the req it would be more helpful
|
|
|
|
|
what you need to do is add an "Insert Command" to the gridview
here is a code to an example with code doing this:
http://geekswithblogs.net/casualjim/articles/51360.aspx[^]
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I found how to write an entire GridView to a new excel file but what I am wanting is to just write
like Textbox1.Text to row 7 cell 3.
How would I go about doing this?
|
|
|
|
|
you would use the Microsoft SDK for controlling office in .NET to do that.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i added a crystal report to one of my asp.net pages and it works fine in the sense that its loaded and displayed on the screen and paging and everything works.
But whenever i click on the export or print menu on the report it doesn't do either. i am not sure what i am doing wrong is that i am suppose to set something in the code behind? or some event needs to be set i am not sure.
so can anyone tell me how i can allow my crystal report to be exported or printed?
|
|
|
|
|
<CR:CrystalReportViewer ID="rptViewer" runat="server" AutoDataBind="true" DisplayGroupTree="False" EnableDrillDown="False" EnableToolTips="False" HasCrystalLogo="False" HasSearchButton="False" HasToggleGroupTreeButton="False" PrintMode="pdf" ReuseParameterValuesOnRefresh="True" />
That's my code for the report viewer
Are you binding to the report view programmatically?
I know I've seen this problem but I'm still trying to recall how we fixed it. Did you enable viewstate?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="reports.aspx.cs" EnableEventValidation="false" EnableViewState="true" Inherits="reports" %>
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
yes i am binding it programically is that the problem? i did all of the above and its still not working
|
|
|
|
|
i know when you got to print or export it queries for new data.
i thought that enableviewstate=true was the fix.
do you pass the report view logon credentials in the code? or do you type them into the form
[edit]
that's actually probably a dumb question. but if you dont pass the logon credentials and just bind the report file to the view then perhaps when you attempt to print or export it is just getting locked out.
[/edit]
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
modified on Thursday, May 22, 2008 2:06 PM
|
|
|
|
|
Hi
I am new to ASP.net calendar control. I figured out most of the things except following:
1. How to display last 6 (or 9 or 12) months of calendar on a page. So that user can simply click on a date to open a new page with the data related to that date.
2. Want to disable all the date links before certain date because there is no information in system before that date. Of course, any future date links should be disabled too.
Please advise. Thanks
Pankaj
|
|
|
|
|
You cannot do it with the standared calender control .You will have to create a custom one yourself.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
|
You might need to change the format of your date
Plus you have spelt where wrong in your query
|
|
|
|