|
You know 'window.print()' function will print the HTML content of the current page in the browser window.
Put the image in a DIV tag and then use the following code. The content of the DIV is written to a new window and then printed in this code.,
<script type="text/javascript">
function ClientSidePrint(idDiv)
{
var w = 600;
var h = 400;
var l = (window.screen.availWidth - w)/2;
var t = (window.screen.availHeight - h)/2; var sOption="toolbar=no,location=no,directories=no,menubar=no,
scrollbars=yes,width=" + w + ",height=" + h + ",left=" + l + ",top="+t;
var sDivText = window.document.getElementById(idDiv).innerHTML;
var objWindow = window.open("", "Print", sOption);
objWindow.document.write(sDivText);
objWindow.document.close();
objWindow.print();
objWindow.close(); }
</script>
|
|
|
|
|
hi iam using asp.net2.0 with c#
In the gridview 1st column is checkbox,in my gridview iam using paging , iam dispalying data from views so there is no primary key and displaying at page load event,
when user selects the check box that records are stored in database.
but when i selects the checkbox at 1st page then it is
storing all the records but when i selects the 1st page records as well as 2nd page records
then it is storing only second page records .
the selected records i have to display in other new page
iwant to store all the records what ever user has selects the checkbox.
can you give me example which helps me.
|
|
|
|
|
Store all "checked item" before you are rebinding the data for next page. Use a javascript function to get those "checked item"'s id and store in hidden field. In the new page you get this hidden fieldds id value to know which have been checked.
Thanks,
Arindam D Tewary
|
|
|
|
|
can you give me example which helps me
|
|
|
|
|
Hi,
you could also subscribe to the CheckedChanged event of your checkbox and save some identifying
information to ViewState for Checkboxes with chkXY.Checked = true.
Use the index of the row or whatever if you dont have a identifying key for that row.
That means:
- Use CheckedChanged event of your checkbox (which is inside a column template)
- if checked = true, add it to a (your) collection saved in ViewState
- if checked = false, remove it from a (your) collection saved in ViewState
- On "Do-My-Saving-To-DB-Stuff-Button-Click":
Iterate through your "selectedItemsCollection" which is saved in ViewState and add the records
Michael
|
|
|
|
|
|
Hi All,
I have done project in ASP.NET2005 Using(VB.NET) But afetr moving files to live the server controls are not displaing in website.
And when I view the source in browser the following code is diplayed.
<%@ page language="VB" autoeventwireup="false" inherits="_Default, App_Web_ze5jfhnt" %>
<title>Login
<asp:image id="imglogo" runat="server" imageurl="./Images/Logo.gif">
| Admin Login | | User Name :
|
<asp:textbox id="TextBox1" runat="server">
| Password :
| <asp:textbox id="TextBox2" runat="server" textmode="Password">
|
| <asp:button id="Button1" runat="server" text="Login" cssclass="btn"> |
pls help me
Thanks in advance
Regards,
Jay
|
|
|
|
|
- Check the server has .NET Framework installed.
- Is it showing as error (Yellow Page) or normally?
|
|
|
|
|
Hi Castle Rider,
Its not showing any error. only the HTML content is displaying but the server controls like (Text Box, Button) are not displaying.
In Server donet frame work is installed but the .net is not installed.
pls help me..
Regards,
Jayakar
|
|
|
|
|
S Jayakar wrote: In Server donet frame work is installed but the .net is not installed.
What do you mean by that?
Check the properties on the Website on IIS whether correct .NET Framework is choosen for that website.
|
|
|
|
|
Hi Castle Rider,
Thanks for the reply.
I got the solution. Installed ASP.NET server(C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i)
and now its working fine.
Thanks a lot for the help...
Regards,
Jay
|
|
|
|
|
I'm looking to create an asp.net video library page for my website to contain all of my site's videos. I really like the way websites such as cnn.com & ign.com have their's setup:
http://www.cnn.com/video/
http://xbox360.ign.com/dor/objects/42417/tom-clancys-splinter-cell-conviction-collectors-edition/videos/sc_spc_stealth_040110.html
Anyone know of any tutorials or software that could help me to develop a similar page on my site?
Thanks.
|
|
|
|
|
There aren't any tutorials for this, its up to you to devise a scheme that works for you and implement it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have a page with a Repeater. The rows from the Repeater after setting its datasource is as follows:
Row1:
LinkButton | Column1 | Column2
- asp:Panel with HtmlTable and additional repeater
Row2:
LinkButton | Column1 | Column2
- asp:Panel with HtmlTable andadditional repeater
The initial load of the data only shows the row with LinkButton, the Panel and HtmlTable is to show only when the LinkButton of that row is selected. If there are two rows, the first linkbutton is clicked, it shows the Panel and HtmlTable for that row - if row 2's panel and HtmlTable is showing it needs to collapse and hide and only show the selected rows data.
Hope this makes sense so far.
The problem I am having is that now matter what Linkbutton I click, I am only getting the first instance of the items in the repeater. Meaning, I click row 2 and can only seem to get the reference to row 1's Panel and HtmlTable.
I guess my initial question would be what is the correct way to be able to get the right control based on what linkbutton is clicked?
Here is my click event for the linkbutton - what this does is once clicked it just needs to show the Panel associated with that link button.
The code below is how I am trying to get a reference to the controls for that row.
I put a HiddenField in the repeater that will tell me in the code below if we are to Expand the Panel (visible) or Collapse the Panel (hide it).
When I click the first LinkButton on Row 1 here is the ID I get back from my controls:
LinkButton returns:
ctl00_MainContent_tabContainer_tabSearchFilings_SD1_rptResults_ctl01_lnkButton
HiddenField
ctl00_MainContent_tabContainer_tabSearchFilings_SD1_rptResults_ctl01_hidrptCourtOrderResults
The panel that is brought back when I do a FindControl (see code below) is this:
Panel returns:
ctl00_MainContent_tabContainer_tabSearchFilings_SD1_rptResults_ctl01_pnlExpand
So we match, but this is the first row.
Clicking the second rows LinkButton produces this result:
LinkButton returns:
ctl00_MainContent_tabContainer_tabSearchFilings_SD1_rptResults_ctl02_lnkButton <-- WE now have ct102!
Panel returns:
ctl00_MainContent_tabContainer_tabSearchFilings_SD1_rptResults_ctl01_hidrptCourtOrderResults<-- this is still row 1's reference
so now that I cannot get the ct102's reference I can only show row 1's Panel, not row 2's...
Any idea what I am missing? Hope this made sense, ask if it didn't.
Here are two screenshots to help explain what I am talking about.
http://i327.photobucket.com/albums/k459/Welborn08/singleRows.gif[^]
http://i327.photobucket.com/albums/k459/Welborn08/expanded_row1.gif[^]
protected void lnkButton_Click(object sender, EventArgs e)<br />
{<br />
HiddenField _hid = (HiddenField)rptResults.Items[0].FindControl("hidrptCourtOrderResults");<br />
<br />
if (null != _hid)<br />
{<br />
Panel _pnlExpand = (Panel)rptResults.Items[0].FindControl("pnlExpand");<br />
<br />
<br />
if (_hid.Value == "Expand")<br />
{<br />
<br />
Repeater _rptResults = (Repeater)rptResults.Items[0].FindControl("rptCourtOrderResults");<br />
<br />
if (null != _rptResults)<br />
{<br />
#region Real Data<br />
HiddenField _hidCaseOwnerID = (HiddenField)rptResults.Items[0].FindControl("hidCaseOwnerID");<br />
HiddenField _hidCaseNum = (HiddenField)rptResults.Items[0].FindControl("hidCaseNum");<br />
HiddenField _hidCaseStatus = (HiddenField)rptResults.Items[0].FindControl("hidCaseStatus");<br />
<br />
string caseOwnId = "";<br />
string casenum = "";<br />
string casestatus = "";<br />
<br />
if (null != _hidCaseOwnerID)<br />
{<br />
caseOwnId = _hidCaseOwnerID.Value.ToString();<br />
}<br />
<br />
if (null != _hidCaseNum)<br />
{<br />
casenum = _hidCaseNum.Value.ToString();<br />
}<br />
<br />
if (null != _hidCaseStatus)<br />
{<br />
casestatus = _hidCaseStatus.Value.ToString();<br />
}<br />
<br />
DataSet dsCourtData = fetchCourtData(caseOwnId, casenum, casestatus);<br />
<br />
if (dsCourtData.Tables.Count > 0)<br />
{<br />
_rptResults.DataSource = dsCourtData;<br />
_rptResults.DataMember = "Table1";<br />
_rptResults.DataBind();<br />
}<br />
<br />
_pnlExpand.Visible = true; <-- this should be row2's pnlExpand but only row1 reference is returning<br />
#endregion <br />
}<br />
<br />
_hid.Value = "Collapse";<br />
}<br />
else<br />
{<br />
_pnlExpand.Visible = false;<br />
_hid.Value = "Expand";<br />
}<br />
<br />
}<br />
<br />
<br />
}
|
|
|
|
|
I found the answer to my problem.
The problem was I was looking in 'rptResults.Items[0].FindControl("hidrptCourtOrderResults");' for my controls and I forgot I could iterate through Item Collection of the Repeater to get the controls.
So I am doing this:
<br />
foreach(RepeaterItem rptItem in rptResults.Items)<br />
{<br />
<br />
<br />
}<br />
|
|
|
|
|
Pls i need help on how to implement message queing and multithreading in an application i am currently working with.
IT'S GREAT TO BE HERE
|
|
|
|
|
These are very broad topics, can you be a little more specific as to what you trying to accomplish and when help you need?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Pls if you don't mind i'm an upcoming programmer and just want to venture into multithreading and message queing so i can use them in building some type of applications sooner or later. im still a student and ready to learn. if i can get taught by using a real life exaple or walk through i can always apply to any kind of large application i may want to build.
IT'S GREAT TO BE HERE
|
|
|
|
|
Think of a windows app that need to read a large amount of data, or a large file, while the continues to do other tasks. This is a classic use and example of multithreading. The data or file access must be done on a separate thread to keep the UI responsive. If you want to add complexity, have the UI report progress of the operation.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi
I have used this dll(PDFLibNet.dll) to load and convert a specefic page of a PDF file to png
in a windows project it works properly but in asp.net website a problem raised.
after using this method by user like 10 or 20 or ... times that is not regular it can not read text from Pdf file and only converts the picture in a specefic page .
my code is like this :
PDFLibNet.PDFWrapper pdfDoc = new PDFWrapper();
pdfDoc.RenderDPI = dpi;
pdfDoc.LoadPDF(root);
Guid outGuid = Guid.NewGuid();
string output = destPath + "\\" + outGuid.ToString() + ".png" ;
PDFLibNet.PDFPage pdfPage = pdfDoc.Pages[pagenumber];
Bitmap bmp = pdfPage.GetBitmap(dpi , true);
bmp.Save(output, System.Drawing.Imaging.ImageFormat.Png);
bmp.Dispose();
pdfDoc.Dispose();
return outGuid.ToString() ;
tanks for your attention.
|
|
|
|
|
You are running your application from VS IDE or From IIS ?
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I have ran this in both VS AND IIS
it is same in error
|
|
|
|
|
use ExportJpg(...)
PDFLibNet.PDFWrapper wrap = new PDFLibNet.PDFWrapper();
wrap.RenderDPI = 85.0;
wrap.LoadPDF(@"E:\Sources\usb_20\OTG Supplement v1.2.pdf");
PDFLibNet.PDFPage page;
foreach (int i in wrap.Pages.Keys)
{
file = dir + i + ".jpg";
page = wrap.Pages[i];
try
{
wrap.ExportJpg(file, i, i, 75.0, 100, 1000);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
|
|
|
|
|
public Image ExportPageAsImage(string pdffileName,int pageNumber)
{
PDFWrapper m_pdfWrapper=new PDFWrapper();
PDFPage m_page;
m_pdfWrapper.LoadPDF(pdffileName);
m_dpi = 96;
m_page = this.m_pdfWrapper.Pages[pageNumber];
Bitmap bmp = m_page.GetBitmap(m_dpi);
return (Image)bmp;
}
RVN
|
|
|
|
|
I need to change ReadOnly from false to true for one column in GridView depending on who the user is. In my particular case it is a BoundField (also I would like to know how to do it for a Template field as well) and DataField is "dteRequired". I would like to code something like that right in the Page_Load handler:
GridView1.Columns["dteRequired"].ReadOnly = true;
but I am getting compile errors...
Any idea?
Thank you.
|
|
|
|