|
It certainly sounds like your grid's data source is somehow getting reset to its apparent starting value of BLL.allBooks(). Have you considered creating a DataSet, DataTable or DataView from BLL.allBooks and having your PopulateList method update the desired column with 'CopiesOrdered', accepting those changes, and then setting your grid data source to that object?
|
|
|
|
|
I am doing work in asp.net using c# in VS2008. I would like to give output in java script window because client dont want button and address, tool bars. so i need to design my own window for out put. I am very new in this field. I really don know which ddl i need to use and where i need to place code (in html, in page_load)
Can any one please help me in this regard?
thanks
|
|
|
|
|
Member 2842468 wrote: I am very new in this field.
Then you probably shouldn't have taken on the work.
only two letters away from being an asset
|
|
|
|
|
Tell your client you were ripping them off, then buy a book and read it before taking more work. also, when you have ASP.NEt questions, use the ASP.NEt forum.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Member 2842468 wrote: I would like to give output in java script window because client dont want button and address, tool bars.
That is not possible. Even if you open a new window using Javascript, you can't get rid of the address field.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
yes,
this is possible
from javascript, use:
window.open(url, targetFrame, "toolbar=no,width=500,height=500,resizable,scrollbars");
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
No, it's not possible. That doesn't remove the address field.
(It might work it if the page is a file on your own computer, but that's not really relevant.)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi.
How to get html from url requiring login, with c#? First login the page and then get html.
for instance this url: https://www.google.com/accounts/Login?continue=http://www.google.com/
|
|
|
|
|
Send the login information in a post to the login page and get the cookies that you get in the response. Put the cookies in the request when you get pages that require login.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I try this, but is not working. Not login.
CookieContainer cookie = new CookieContainer();
string pageData = string.Empty;
StreamReader respReader = null;
label1.Text = "Finding Site ...";
Application.DoEvents();
HttpWebRequest _mainRequest = (HttpWebRequest)WebRequest.Create("https://www.google.com/accounts/Login?continue=http://www.google.com/");
label1.Text = "Setting Parameters";
Application.DoEvents();
_mainRequest.Method = "POST";
_mainRequest.ContentType = "application/x-www-form-urlencoded";
_mainRequest.CookieContainer = cookie;
label1.Text = "Building String to Send";
Application.DoEvents();
StreamWriter reqWriter = new StreamWriter(_mainRequest.GetRequestStream());
label1.Text = "Sending Form data";
Application.DoEvents();
reqWriter.Write("Email=" + myMail + "&Passwd=" + myPass);
reqWriter.Close();
label1.Text = "Closing Response from Site";
Application.DoEvents();
_mainRequest.GetResponse().Close();
label1.Text = "Looking up secure Site";
Application.DoEvents();
_mainRequest = (HttpWebRequest)WebRequest.Create("http://www.google.com.tr");
_mainRequest.CookieContainer = cookie;
label1.Text = "Getting Response from Site";
Application.DoEvents();
respReader = new StreamReader(_mainRequest.GetResponse().GetResponseStream());
pageData = respReader.ReadToEnd();
label1.Text = "Cleaning up";
Application.DoEvents();
respReader.Close();
label1.Text = "Ready";
textBox1.Text = pageData;
Application.DoEvents();
|
|
|
|
|
You didn't get the cookies from the response.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
thank you. did work.
I using timer. but, page source code not refresh. Why?
|
|
|
|
|
macsheriff wrote: I using timer. but, page source code not refresh. Why?
Well, that's hard to say without knowing anything about your code. In what way would the source code refresh, and how would the timer cause that to happen?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I'm new to C# and trying to add a new row to my form using tableLayoutPanel using an Add button. When I click the Add Button I believe a new row is added but the previous row disappears. I've search the web and MS for help and followed their suggestions, but continue to receive the same results. Below is the code used in the click button method
private void buttonAddDebt_Click(object sender, EventArgs e)
{
// Set the GrowStyle to Add Rows.
debtTableLayoutPanel.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
// Ensure the AutoSize property is set to allow for the row to be added
debtTableLayoutPanel.AutoSize = true;
// Set Row Number to Be inserted
int InsertRowNum = debtTableLayoutPanel.RowCount;
debtTableLayoutPanel.AutoScroll = true;
debtTableLayoutPanel.Visible = true;
// Increment the row count by one for the new row.
debtTableLayoutPanel.RowCount++;
// Insert new RowStyles for correspoinding new row
RowStyle newRowStyle = new RowStyle();
newRowStyle.SizeType = SizeType.Absolute;
newRowStyle.Height = 30;
debtTableLayoutPanel.RowStyles.Insert(InsertRowNum,newRowStyle);
// Add the new row
debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(SizeType.Absolute, 30));
// Add controls to the new row
debtTableLayoutPanel.Controls.Add(textBoxDebtAmount, 0, InsertRowNum);
debtTableLayoutPanel.Controls.Add(textBoxInterestRate, 1, InsertRowNum);
debtTableLayoutPanel.Controls.Add(listBoxDebtType, 2, InsertRowNum);
debtTableLayoutPanel.Controls.Add(listBoxCompoundingFrequency, 3, InsertRowNum);
debtTableLayoutPanel.Controls.Add(numericUpDownAmortizationPeriods, 4, InsertRowNum);
debtTableLayoutPanel.Controls.Add(listBoxPaymentFrequency, 5, InsertRowNum);
debtTableLayoutPanel.Controls.Add(listBoxPaymentType, 6, InsertRowNum);
debtTableLayoutPanel.Controls.Add(textBoxPaymentAmount, 7, InsertRowNum);
/*
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 29F));
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.debtTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.debtTableLayoutPanel.Size = new System.Drawing.Size(620, 27*debtTableLayoutPanel.RowCount);
*/
debtTableLayoutPanel.TabIndex++;
debtTableLayoutPanel.Visible = true;
} // end buttonAddDebt_Click
|
|
|
|
|
looking at the designer.cs file after dropping a TableLayoutPanel on a form, it produces 2 columns and 2 rows by using this code which you should be able to use as the base for your code:
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(
new System.Windows.Forms.ColumnStyle(
System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(
new System.Windows.Forms.ColumnStyle(
System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(
new System.Windows.Forms.RowStyle(
System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(
new System.Windows.Forms.RowStyle(
System.Windows.Forms.SizeType.Percent, 50F));
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
hi evreyone
how i can make Beep in WinCE (C#) ?
thank's for any help
|
|
|
|
|
Not sure about CE, but try System.Console.Beep()
|
|
|
|
|
MSDN[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
using System.Runtime.InteropServices;
....
public static extern void MessageBeep(int code);
public static void MessageBeep()
{
MessageBeep(-1); // Default beep code is -1
}
|
|
|
|
|
Ok I want to make a simple tool to send a few key strokes to a background application.
I found a few examples but these will always call it to the foreground and that is a problem. cause it needs to be done all in the back ground.
Some example applications or code snippets in C# would be nice.
|
|
|
|
|
You'll need FindWindow or FindWindowEx and SendMessage or SendMessageEx both in user32.dll.
Check out http://www.pinvoke.net/[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
while (loadme.ReadLine() != "];")
{
frame[framenum] = loadme.ReadLine();
framenum += 1;
}
"Index was outside the bounds of the array."
how to fix this?
loadme is a StreamReader
frame is a String[]
framenum is an int
|
|
|
|
|
Most likely your array is smaller than the number of lines returned until you encounter the string "];"
Set the array size to a proper value or use a List<string> instead.
Your code looks wrong though, you're reading each line twice. This would be better:
while((line = loadme.ReadLine()) != "];")
{
AddToArray(line);
}
modified 12-Sep-18 21:01pm.
|
|
|
|
|
use List<string> to replace string[],
you doesn't to set its length, but save it use .Add methods.
if you want to use string[], you should declare its length
greater than the line count of the file. seems you are reading from a file.
Glad to discuss with you and best wishes.
|
|
|
|
|
WuJunyin wrote: if you want to use string[], you should declare its length
greater than the line count of the file.
file length varies, how do I get the length of a file in lines, not chars?
|
|
|
|