|
Hello everyone,
I am using loadcontrol method to load custom controls.
I have a single .aspx page and a left menu (.ascx control) which is loaded dynamically.
When i click on the left menu's link, control is loaded accordingly.
The problem is:
Loadcontrol always loads control with ispostback=true.
It happens bcoz i have used __doPostBack() onclick of the leftmenu's link.
I want the ispostback = false in the control's load event.
Any help is always welcome.
Thanks,
Malay Khandhediya.
|
|
|
|
|
Double post
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I created a simple key logger application and the user's key strokes are stored just in the memory of the computer.. this time i made use of a socket.. so i created another application that will remotely control that key logger.. and one of the function is to be able to retrieve the key strokes from the remote computer and send it to the application which controls the keylogger remotely.. it worked in my localhost.. but when i used it in two different computers the connection of each was successful, but the buffered keystrokes doesnt show up... i'm suspecting its firewall... so i disabled the firewall of the remote computer.. here's my question, in sockets, do i have to turn off BOTH of the computer's firewall to let it work? is there a way to bypass the firewall? cause if there's no other way i'm going to let the program itself disable the firewall which I dont want.... or maybe its not the firewall causing it.. any idea?
|
|
|
|
|
If your a doing this for a Good Purpose you wouldnt worry about the Firewall, you can tell the person who owns the remote PC to turn the keylogger off. but i suspect you are creating something malicious here. So we cannot help you do that.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
what is compile time polymorphism and run time polymorphism.give 1 line description
|
|
|
|
|
Do your own homework. Buy a book. Learn to google.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
|
WTF !
|
|
|
|
|
Ram_Bytes wrote: give 1 line description
No. Not until you buy me some flowers and say please. I don't put out on a first date.
|
|
|
|
|
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This is ridiculous.
You posted the same question yesterday and people gave their time to reply, you are shameless enough to post the same question again.
Did you even read what all answers were given you.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This guy is only asking homework questions. Ignore.
Blog link to be reinstated at a later date.
|
|
|
|
|
Ram_Bytes wrote: give 1 line description
Ahem... I liked The Matrix too.
Wouldn't it be nice to plug a cable in the back of your head and after 3 seconds you go... 'I know C++'
Study if you want to learn.
|
|
|
|
|
Hi all,
I want to restrict the Tree Node label length,when the label is being edited.
How can i accomplish this.
Thanks in Advance,
San
|
|
|
|
|
Create a dialog for editing the label and set the restrictions in the dialog for how the label can be changed. Disable the native label editing in the tree node and handle an event (possibly click) to show the dialog.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Here is mycode:
<br />
private void NullAndRelease(object runtimeObject)<br />
{<br />
try<br />
{<br />
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(runtimeObject);<br />
}<br />
catch {}<br />
finally<br />
{ <br />
runtimeObject = null; <br />
}<br />
}<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();<br />
object NullParam = System.Reflection.Missing.Value;<br />
Workbook Book = ExcelApp.Workbooks.Open(FileName, 0, true, NullParam, NullParam, NullParam,<br />
true, NullParam, NullParam, false, false, NullParam, false, true, NullParam);<br />
Worksheet Sheet = Book.Worksheets[1] as Worksheet;<br />
Range UsedRange = Sheet.UsedRange;<br />
<br />
Range Cell = null;<br />
int RowCount = UsedRange.Rows.Count;<br />
for (int i = 2; i <= RowCount; i++)<br />
{<br />
Cell = UsedRange.Cells[i, 1] as Microsoft.Office.Interop.Excel.Range;<br />
Cell = UsedRange.Cells[i, 2] as Microsoft.Office.Interop.Excel.Range;<br />
Cell = UsedRange.Cells[i, 3] as Microsoft.Office.Interop.Excel.Range;<br />
Cell = UsedRange.Cells[i, 4] as Microsoft.Office.Interop.Excel.Range;<br />
Cell = UsedRange.Cells[i, 5] as Microsoft.Office.Interop.Excel.Range;<br />
Cell = UsedRange.Cells[i, 6] as Microsoft.Office.Interop.Excel.Range;<br />
NullAndRelease(Cell); <br />
}<br />
NullAndRelease(Cell);<br />
NullAndRelease(UsedRange);<br />
NullAndRelease(Sheet);<br />
if (Book != null)<br />
Book.Close(false, NullParam, false);<br />
NullAndRelease(Book);<br />
ExcelApp.Quit();<br />
NullAndRelease(ExcelApp);<br />
GC.Collect();<br />
GC.WaitForPendingFinalizers(); <br />
}<br />
These code works well.But when I add the following code in the for loop:
<br />
Cell = UsedRange.Cells[i, 7] as Microsoft.Office.Interop.Excel.Range;<br />
The server does not shut down. It seems that I can only read not more than 6 cells.That's why?
|
|
|
|
|
Hi,
I don´t like to use(in some situations) "created object from the toolbox" i like to, if possibly, use code.
To connect to a database i code the dataset, i don´t use the created object from the toolbox.
I download some projects that create the dataset to crystal reports not coding but by the toolbox.
I have coded a dataset/connection to a database and i would like to connect to crystal report using also code!!! not the dataset toolbox
Is there a crystal report sample that created dataset by code? the ones i downloaded use the dataset toolbox.
thanks
nelsonpaixao@yahoo.com.br
|
|
|
|
|
In C++, this would be exteremely easy (I can think of a couple of methods off the top of my head).
Yet... Is there a way in Pure C# to do this?
Just to clarify: I am talking about taking a void* (returned from a function like CoCreateInstance) and accessing a function without going through C# Com Interop. I read somewhere that someone did this by accessing the vtable of the interface pointer though he or she failed to mention how he or she did this.
Thank you in advance.
|
|
|
|
|
List<string[]> salesPeriod = new List<string[]>();<br />
string[] totalPeriodNo = new string[3];<br />
<br />
<br />
totalPeriodNo[0] = "AA";<br />
totalPeriodNo[1] = "0.01";<br />
totalPeriodNo[2] = "0.02";<br />
totalPeriodNo[3] = "0.03";<br />
salesPeriod.Add(totalPeriodNo);<br />
<br />
<br />
totalPeriodNo[0] = "BB";<br />
totalPeriodNo[1] = "0.06";<br />
totalPeriodNo[2] = "0.07";<br />
totalPeriodNo[3] = "0.08";<br />
salesPeriod.Add(totalPeriodNo);<br />
How can I go about editing BB for period 3 from 0.08 to 1.33 ?
|
|
|
|
|
Okay, a List has random-access support so just edit it the same way you would an array.
salesPeriod[1][3] = "1.33";
Hope that helps.
|
|
|
|
|
As you have added the same array to the list twice, you have a list with two reference to the same array. Therefore there is three ways of changing the period:
totalPeriodNo[3] = "1.33";
salesPeriod[0][3] = "1.33";
salesPeriod[1][3] = "1.33";
Either of these will change the item in the array. As the list is just two references to the same array, the change will be visible in both items of the list.
If you want two separate items in the list, you have to create a new array object before populating it with the BB data.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Maybe it was just a typo in your sample, but:-
string[] totalPeriodNo = new string[3];
declares a string array with 3 elements. These elements are indexed as 0, 1 and 2
so, your line:-
totalPeriodNo[3] = "0.03";
will throw an exception.
|
|
|
|
|
/method to convert decimal stored in "nDecimal"
//to two's complement representation, stored in array "bitstring"
private void decimal_to_twoc( )
{
int nDecimal = Convert.ToInt32(decimal_input.Text);
//string numBits = Convert.ToString(decimal_output.Text);
int carry = 1;
int flag = 0;
if (flag==0)
{
for (int i = 0; i < 8; i++)
bitstring[i] = bitstring[i] + 2;
bitstring[nDecimal] = carry;
carry = 0;
if (bitstring[nDecimal] > 1)
{
bitstring[nDecimal] = 0;
carry = 1;
It is givingme a wrong conversion from decimal to two's complement and I can figure out the reason. Any help please?
|
|
|
|
|
What are you trying to do ? Where is bitstring defined ? Obviously, it's not reset in this function, so whatever value it had, 2 is added to every element. I don't see how you remotely are interacting with the decimal, except as an index into an array. So, if your array has 8 elements, as it seems, a number > 8 will just crash it, right ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
This is where I started from, thanks.
.............................................................
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace TwosComplement
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
for (int i = 0; i < 8; i++)
{ bitstring[i] = 0;}
twoc_output.Text = "enter an integer";
decimal_output.Text = "enter a length 8 bitstring";
}
private int[] bitstring = new int[8];
private int nDecimal;
//strings for reading the bitstring in and out
private string instring, outstring;
private string nextbit;
//helper function for flipping bits in the bitstring
private int negate(int x)
{
if (x == 1) return 0;
return 1;
}
//method to convert decimal stored in "nDecimal"
//to two's complement representation, stored in array "bitstring"
private void decimal_to_twoc( )
{
int nDecimal = Convert.ToInt32(decimal_input.Text);
string numBits = Convert.ToString(decimal_output.Text);
int carry = 1;
int flag = 0;
if (flag==0)
{
for (int i = 0; i < 8; i++)
bitstring[i] = bitstring[i] + 2;
bitstring[nDecimal] = carry;
carry = 0;
if (bitstring[nDecimal] > 1)
{
bitstring[nDecimal] = 0;
carry = 1;
}
}
}
|
|
|
|