|
|
Read the file in arraybytes format and and throught streamwriter write the arraybytes one you get the arraybytes.
|
|
|
|
|
wrote: I need to automatic upload a file to the client machine,could any one help me on how to do that
Do you want to upload file from client to server or download from server to client. ? If you want to copy file from server to client, ASP.NET should have write access in the client machine where u want to copy the file
|
|
|
|
|
wrote: upload a file to the client machine
The above phrase means download, not upload...
|
|
|
|
|
yes, i need to download file from web server to client machine
Marwa
|
|
|
|
|
I am having some issues with some of my code which is based around creating properties inside a user control and then having the page that the user control resides in work with these properties.
Code is as follows:
Private IntendedType As String<br />
<br />
Public Sub SetIntendedType(ByVal IntendedType As String)<br />
IntendedType = IntendedType<br />
End Sub 'Set Intended Type<br />
<br />
Public Function GetIntendedType() As String<br />
Return IntendedType<br />
End Function 'Get Intended Type
Sits inside the user controls page behind code. The next chunk of code is in the encapsulating pages page_load event.
If Not dr.IsDBNull(15) Then<br />
CreditRatingControl.SetIntendedType(dr(15))<br />
End If<br />
If Not dr.IsDBNull(16) Then<br />
CreditRatingControl.SetIntendedUse(dr(16))<br />
End If<br />
If Not dr.IsDBNull(17) Then<br />
CreditRatingControl.SetIntendedPurpose(dr(17))<br />
End If
Obviously that part is sat inside a datareader while loop but I have ommited this. And then finally I have this inside the user control page load
<br />
SetIntendedPurpose("c**k")<br />
Label13.Text = GetIntendedPurpose() + GetIntendedType() + GetIntendedUse() + "Poo"
All I get is "poo" shown on the page. Now surely the values set from the data retrieval should have been passed in. Am I any where close with this code or not?? Does this kind of approach even work?
Thanks in advance
|
|
|
|
|
Sounds like the page_load functions aren't running in the order you would expect - ie the user control page_load is running before the page. Is this running as part of a post back or not? If its not a postback, I'm pretty sure the user control wouldn't even exist as CreateChildControls shouldn't run until after the pages page_load. If it is a postback, CreateChildControls runs before the pages page_load and it might mean the controls page_load runs first (before the properties are set). Let me have a look and I'll get back to you sweetheart.
|
|
|
|
|
Yeah I was thinking similar thoughts but thats why I added that C**k line in. Surely that should set the property to have a value as it displays it on the next line. Sure it's not something to do with different instances of the same properties?!
|
|
|
|
|
Will this line here actually work?:
IntendedType = IntendedType
As you know I can't stand VB.NET but in C# this would set the local variable to its own value, to set the private class variable you'd need:
this.IntendedType = IntendedType
(Not sure if thats what you need in VB)
|
|
|
|
|
Yeah you were right. Although the VB.net keyword is "ME". Would it have made a differece if I had called my variables different names??
There was this other bit of code that you might know
If Me.C**k.Length > Rory.C**k.Length Then As String<br />
Return Reality <br />
Else<br />
Return Bullshit<br />
EndIf
Do you follow that one?
|
|
|
|
|
Sam Heller wrote: Would it have made a differece if I had called my variables different names??
Yes
Sam Heller wrote: Do you follow that one?
Not really, it seems to give the wrong answer to me. Don't you need a less than instead of a greater than? Do you follow this?:
if(jon.iq > rory.iq) {<br />
return "not a chance";<br />
} else {<br />
return "you can suck me later";<br />
}
|
|
|
|
|
Select Case Person<br />
Case "Rory"<br />
WomanWillSuckHimOff = False<br />
Case "Jon"<br />
WomanWillSuckHimOff = True
|
|
|
|
|
HI all,
Here am using Datagrid in my Project.I placed checkbox in the first column of it.By selecting the checkbox,user can delete appropriate Row,this is all usual stuff and i managed to do this.But here my problem is when any row is deleted from it,displaying as all r deleted and wrong page index,i mean earlier,grid is having 4 items,after deletion also it showing {0}-{1} of {3}.Pls suggest me what to do.Did i apply rebind() again.and anyother?????
Thanks in advance
Have a Nice Day Dudes
|
|
|
|
|
when you delete something from gridview it is temporary try rebinding it refreshes the gridview
|
|
|
|
|
Yes,you need to Bind to DataBase agian.
|
|
|
|
|
I am doing this and only the last textbox is there and rest of them are not there. Please help me out friends its very urgent.
Txt.ID = "SubmitBtn1"
Txt.TextMode = TextBoxMode.MultiLine
PlaceHolder1.Controls.Add(Txt)
PlaceHolder1.Controls.Add(New LiteralControl(" "))
Txt.ID = "SubmitBtn2"
Txt.TextMode = TextBoxMode.MultiLine
PlaceHolder1.Controls.Add(Txt)
PlaceHolder1.Controls.Add(New LiteralControl(" "))
Txt.ID = "SubmitBtn3"
Txt.TextMode = TextBoxMode.MultiLine
PlaceHolder1.Controls.Add(Txt)
PlaceHolder1.Controls.Add(New LiteralControl(" "))
Txt.ID = "SubmitBtn4"
Txt.TextMode = TextBoxMode.MultiLine
PlaceHolder1.Controls.Add(Txt)
Mohinder Singh
|
|
|
|
|
You need to create a new textbox everytime you plan to add one so before the Txt.ID portion of each section call for a new textbox Txt = New Textbox .
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I think even that won't do the trick.
Shouldn't you actually declare an entirely new variable everytime?
TextBox txt1 = new TextBox();<br />
TextBox txt2 = new TextBox();<br />
TextBox txt3 = new TextBox();<br />
TextBox txt4 = new TextBox();<br />
TextBox txt5 = new TextBox();
...
public object BufferOverFlow<br />
{<br />
__get { return BufferOverFlow; }<br />
__set { BufferOverFlow = value; }<br />
}
|
|
|
|
|
Once it's added no. I do this often when populating a datatable with a datarow. You use the same variable, next loop set it to new again then populate and add.
-- modified at 11:43 Monday 19th March, 2007
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I learned something today!
public object BufferOverFlow<br />
{<br />
__get { return BufferOverFlow; }<br />
__set { BufferOverFlow = value; }<br />
}
|
|
|
|
|
Although it may be easier to follow in the case of the OP if different names are used that match the ID given but it isnt required.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I usually use this in a loop, and then I put the declaration in the loop too.
Is this good practice? Or is there no performance difference.
-- modified at 12:08 Monday 19th March, 2007
I threw together this code:
<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
Stopwatch sw = new Stopwatch();<br />
sw.Start();<br />
test1();<br />
sw.Stop();<br />
Console.WriteLine(sw.Elapsed);<br />
sw.Reset();<br />
sw.Start();<br />
test2();<br />
sw.Stop();<br />
Console.WriteLine(sw.Elapsed);<br />
Console.Read();<br />
}<br />
<br />
static void test1()<br />
{<br />
<br />
String testString;<br />
for (int i = 0; i < 50000000; i++)<br />
{<br />
testString = i.ToString();<br />
}<br />
}<br />
<br />
static void test2()<br />
{<br />
for (int i = 0; i < 50000000; i++)<br />
{<br />
String testString;<br />
testString = i.ToString();<br />
} <br />
}<br />
}<br />
pretty fun (clogs for about 17 secs on my pc)... but not really conclusive. I asked a MSIL guru about it. You probably don't care even half as much as I do, but I like these kinds of perf. things.
public object BufferOverFlow<br />
{<br />
__get { return BufferOverFlow; }<br />
__set { BufferOverFlow = value; }<br />
}
|
|
|
|
|
if i add new control at runtime suppose three buttons how can i get the click event of these three buttons.
Mohinder Singh
|
|
|
|
|
if i do this way for the button then i get three buttons but how can i have the click event of these three buttons .
Mohinder Singh
|
|
|
|
|
By setting the event in code.
LinkButton.Click += new System.EventHandler(method);
in VS2005 Intellisense does most of the thinking for you.
public object BufferOverFlow<br />
{<br />
__get { return BufferOverFlow; }<br />
__set { BufferOverFlow = value; }<br />
}
|
|
|
|