|
Unable to Maintain griedview scroll position in to the Internet Explorer Print Preview Window.
Inner html area of the page display properly in to the print preview dialog box. But if there is a scroll in the page and user scroll it, then print preview does not reflect the scroll area of the page.
We have taken inner html of the display area and using ExecWB(7, 2) to bring up the print preview dialog box. When we pass the inner html through the “Window.open” object and call the ExecWB() function then it cannot maintain the div scroll position.
below is our print function:
function printFile() {
var InnerhtmlString = $("#MainBody").html();
var innerDiv = $("<div>");
innerDiv.append(InnerhtmlString);
innerDiv.remove("script");
var html = "<html>";
html += "<head>";
html += "<style type=\"text/css\"> @import url(\"./../CSS/styles.css\"); </style>";
html += "</head><body>";
html += innerDiv.html();
html += "</body></html>";
var printPreviewObject = '<object id="printPreviewElement" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
//var printWin = window.open('', '', 'left=100,top=100,width=1,height=1,toolbar=0,scrollbars=0,status =0');
var printWin = window.open('', 'Print', 'left=100,top=2000,width=700,height=600');
printWin.document.write(html);
printWin.document.write(printPreviewObject);
printWin.document.write('<script language=JavaScript>');
printWin.document.write('printPreviewElement.ExecWB(7, 2);');
printWin.document.write('printPreviewElement.outerHTML = "";this.window.close();');
printWin.document.write('<' + '/' + 'script' + '>');
printWin.document.close();
printWin.focus();
// printWin.print();
// printWin.close();
}
Please Help.
Thanks and regards,
Debasish Chowdhury
modified 9-Aug-12 5:50am.
|
|
|
|
|
How to bind datatable retrived from databse...to radtree view or radtreelist...
datatable has fields one Project name has many Maintasks and one maintask has many Subtasks.
|
|
|
|
|
|
Hello Guys,
My question is simple i want create a website where the user can select the type of language. Please ref the link http://24x7onlineshopping.co.in/default.aspx
i want to achieve this kind of selection. On selecting the language evey thing just changes the language type. I tried googling & found Resource files can be made for each language & found it lengthy but is it possible to acheive globalization using a access database, want i meant is "when the user changes the type of language the culture type should change corresponding to which the whole site's language" Please help me create a website with multi language using database. i hope my point is being delivered. Thanks in anticipation.
Regards,
delhiegle
|
|
|
|
|
|
ya i did look at those articles but they all are using resource files, but i want to use database & culture codes. When the user selects a language, culture code of that will be selected corresponding to which the text from the database should change on the pages.Is this thing acheivable.
|
|
|
|
|
SO you want to take a well known, tested and robust built in mechanism, and reinvent it cos you don't like it....yeah...good luck with that one...
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi All,
I have an asp.net application which is consuming a WCF Service which is using WSHttpBinding, but when I try to call the operation contract of the WCF service I am getting following error.
Can anybody please help me reagrding this. Following is the error description.
Secure channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or implied by the EndpointAddress correctly identifies the remote endpoint.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Check your endpoint. Make sure you are pointing to the appropriate server.
|
|
|
|
|
|
Hello,
in my ASP .NET page I have created check box double clicked it, it then created,
chbCalcPrim_CheckedChanged
method but it never fires. I am changing the state of it i.e. in checked or unchecked but that method is never executed.
What is the problem, should I use any script?
|
|
|
|
|
Is AutoPostBack set to true?
Schenectady? What am I doing in Schenectady?
|
|
|
|
|
My C# application has a help page which is a pop up. Users want to be able to open this, and, while leaving the help open, continue browsing through the applications various pages. On closing the application, the popup will need close as well. Is this achievable? pop ups appear to be associated to the calling page. If the user moves from the page, this relationship is being lost. Can a popup be a child of an application, rather than a page? I am using a master page if that helps, and session variables.
|
|
|
|
|
toltec77 wrote: the popup will need close
Yes it can be done, but you failed to state if it's a modal popup or browser window popup.
If it' the latter
You need to use javascript to open and close the window via the DOM
I think this is correct, off the top of my head, it includes a querystring as well for the aspx page, and generates a fixed size browser window and not a modal popup.
var imageBrowser;
function open_Library(imageType) {
var template = $('[id*="_txt_ProductEditor_Template"]').val();
imageBrowser = window.open("image_Library.aspx?type=" + imageType + "&template=" + template, 'child', "width=900, height=800, location=no, menubar=no, scrollbars=no, status=no, toolbar=no");
if (window.focus) {
imageBrowser.focus();
}
}
imageBrowser.close();
If it's a modal popup, the you close it the opposite way you displayed it.
You were not very clear is explaining what leave application means, and what application is, is it just 1 control, a whole page, an entire website. I'm not a mind reader.
|
|
|
|
|
Thanks for the feedback jkirkerx, although, I have tried this method, but, as I said, when I browse to other pages in the application, or actually even when refreshing the same page, I appear to lose the parent/child relationship between the opener and the imageBrowser. When the opening page has been refreshed, the imageBrowser object is null again. I need to know if I can somehow keep this objects value after multiple postbacks, not just to the same page, but across multiple pages within the application.
As I said "continue browsing through the applications various pages" I had assumed that this would discount modal windows (which I had used, but the client wants to be able to browse other pages whilst keeping the help page open).
Also, closing the application means logging out/closing the session. They could just close the window they are using, but not sure if I can log them out properly that way, that would just end their session, but I wouldn't be doing it.
Hope this clears it up a bit.
|
|
|
|
|
Of course your going to lose the connection to the popup window. That's how it suppose to work by default.
You have to understand, that it's not a windows program, each page in a website is completely independent of each other, and have no relationship, nor to they share data.
In the DOM, the DOM is only valid for the page that created it, when you load a new page, a new DOM is created, breaking all ties to the old DOM.
Like I asked, what is an application?, a control, a page, or and entire website.
I don't know how to extend a DOM across multiple pages, and don't think it's possible. It's sounds like your design exceeds the limitation of a web page.
[EDIT]
this is an explanation of how the DOM works, it's limitations, and various DOM objects that you can access
Also, your post has nothing to do with asp.net, it's a client side javascript issue.
[Document Object Model^]
modified 7-Aug-12 18:51pm.
|
|
|
|
|
Thanks jkirkerx, I was thinking that was how it worked, but the client is very adamant. I was wondering if there was documentation from Microsoft (the application/website is specifically for ie 7 and above only) that verifies this, as my word apparently is not good enough for the client, they need verification that it is unachievable, and I have not been able to locate any.
"or and entire website."
As I said "continue browsing through the applications various pages", I thought this would clear it up? Sorry, but perhaps I am wording it incorrectly? The 'application' is an entire website (although, it consists of only a few pages)
Thanks, and sorry if I was unclear.
|
|
|
|
|
Not at the moment, there's not much on the subject that actually states that. It is assumed that the anonomy of a web page is a single page request from the server in which the browser parses the elements to create a DOM from the body element.
http://www.cornae.com/articles/anatomy-of-a-web-document[^]
Make a post in the Javascript discussion, and perhaps you'll get an answer in a day or so,
Make sure your very very clear in your description, or you will be laughed at, and not taken seriously.
There are work arounds, such as creating 1 superpage, in which the content updates from a web service, and the user never leaves the 1 superpage. But that will takes about 10K lines of Javascript or Jquery and tons of back end server side work.
|
|
|
|
|
I was thinking last night,
This was posted in the JavaScript Discussion
[obfuscated malware^]
It's a piece of malware that was injected into the OP's website. It's quite clever, It uses a hidden iframe that is positioned in the upper left corner of the browser, off the page where it can't be seen, and calls a web page from another server to do something, perhaps ease drop, or download something evil. These guys are quite genius at this stuff.
Anyone correct me if I'm wrong on this
I think a hidden iframe like that can be used to host the master JavaScript, that can communicate with a popup, and the main frame at the same time. Each time the main page changes, it can reestablish a communication link with the hidden iframe.
http://mentaljetsam.wordpress.com/2010/03/15/communicating-between-iframes-and-windows-in-javascript/[^]
I hope I don't any flack for promoting the use of this. But it would be pretty cool once it was working. Might want to use the bytes as well so you don't give up the trade secret as to how you did it.
|
|
|
|
|
Hi,
Why I am getting the following error:
Input string was not in a correct format.
here is my code:
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_connection.Open();
sql_command = new MySqlCommand("sp_add_new_volow_member", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_command.CommandTimeout = 300;
sql_command.Parameters.AddWithValue("param_full_name", txtSignupFullName.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_email_address", txtSignupEmailAddress.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_login_password", txtSignupPassword.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_record_identity", MySqlDbType.Int32).Direction = ParameterDirection.Output;
sql_command.Parameters.AddWithValue("param_record_guid", MySqlDbType.VarChar).Direction = ParameterDirection.Output;
sql_command.Parameters.AddWithValue("param_is_exist", MySqlDbType.Bit).Direction = ParameterDirection.Output;
int result_rows = sql_command.ExecuteNonQuery();
and this is my SQL:
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_add_new_volow_member`(IN param_full_name varchar(255), IN param_email_address varchar(255), IN param_login_password varchar(255), OUT param_record_identity int, OUT param_record_guid varchar(255), OUT param_is_exist bit)
BEGIN
SET param_is_exist = FALSE;
INSERT INTO volow_members (volow_member_full_name, volow_member_email, volow_member_password) VALUES (param_full_name, param_email_address, param_login_password);
SET param_record_identity = LAST_INSERT_ID();
SET param_record_guid = 'abc';
END
|
|
|
|
|
Did you ever bother to check your sql char arrays, and feed them in manually to your database using a management tool, to make sure they work first.
Then test your connection by just selecting records, to make sure your connector works
jrahma wrote: DEFINER=`root`@`localhost`
you have too many quotes
jrahma wrote: sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_connection.Open();
Usually you program your parameters before you open the connection
Your code looks strange to me, and your use of parameters does not look well formatted. The parameters are individual objects, that you add to the SQLCommand, once you build your parameters, you open the database, execute, and close it.
Dim strConnString As String = GetSQLConnString()
Dim objConn As New SqlConnection(strConnString)
Dim strSQL As String = "DELETE FROM ProductInfo WHERE ProductID=@ProductID"
Dim objCmd As New SqlCommand(strSQL, objConn)
Dim paramProductID As SqlParameter
paramProductID = New SqlParameter("@ProductID", SqlDbType.Int)
paramProductID.Value = ProductID
objCmd.Parameters.Add(paramProductID)
Try
'Delete the record in the database
objConn.Open()
objCmd.ExecuteNonQuery()
objConn.Close()
Success = True
Catch ex As Exception
Success = False
End Try
objCmd = Nothing
objConn = Nothing
|
|
|
|
|
I suspect that the problem is with the 3 lines lines starting with:
sql_command.Parameters.AddWithValue("param_record_identity", MySqlDbType.Int32)
AddWithValue expects you to provide the actual values to the parameters instead of the data types (as in the preceeding 2 lines).
|
|
|
|
|
In a C# 2010 form application, I want to change an existing display from being a textbox, to being a popup new window where the user can enter data. Basically there is not enough room for a user to enter a large volume of notes.
Thus can you tell me how a user can click on an existing textbox, and a new window will showup for the user to enter the data. The user will click a save button, the data will be updated in the database potnetially and the user will return to the original window.
I would like to see this using ajax and non ajax code.
|
|
|
|
|
I always wanted to try grow ui, tryed it once, but no luck, but your suppose to be able to grow the textbox larger, and shrink it back
[Grow UI^]
|
|
|
|
|
Please take a look at jQuery UI, especially the dialog component:
http://jqueryui.com/demos/dialog/#modal-form[^]
Using or not ajax is different story as it will only affect whenever whole page will reload or not after user click save.
--
"My software never has bugs. It just develops random features."
|
|
|
|
|