|
What you are trying to do ?
IT takes Stream as an argument There 6 to 7 different constructors
Let me know what are you trying with it ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
i want to do this:
string old = "HTML code";
if (!System.IO.File.Exists("d:\\a.htm"))
{
System.IO.FileStream f = System.IO.File.Create("d:\\a.htm");
f.Close();
using (System.IO.StreamWriter sw = new System.IO.StreamWriter("d:\\a.htm"))
{
sw.Write(old);
}
}
}
and i want open a.html form with this cde:
"<A HREF=" + "javascript:window.open('a.htm')"
but not open a.htm , it open other page.
can i say my mean?? do u understand my mean?/
|
|
|
|
|
Here you are creating a Html file at server side ok
Now you want to open that html file at client side
That not possible dude. i think you have been trying in wrong direction
you will have to create a html file using javascript only at client side
then you can open that file using javascript
Is that fine or i interpreted wrongly
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
System.IO.StreamWriter sw = new System.IO.StreamWriter(@"PATH OF THE FILE")
e.g System.IO.StreamWriter sw = new System.IO.StreamWriter(@"C:\test.txt")
|
|
|
|
|
thanks thats right. and now
how can i open C:\test.txt with this code : javascript:window.open('c:\test.txt') ???? is it right???
|
|
|
|
|
public static Control AdvancedFindControl(this Control container, string controlId)<br />
{<br />
Queue<control> controlQueue = new Queue<control>(new[] { container });<br />
Control currentControl;<br />
<br />
while (controlQueue.Count > 0)<br />
{<br />
currentControl = controlQueue.Dequeue();<br />
<br />
foreach (Control child in currentControl.Controls) { controlQueue.Enqueue(child); }<br />
<br />
if (currentControl.ID == controlId)<br />
<br />
return currentControl;<br />
}<br />
<br />
return null;<br />
} <br />
</control></control>
thanks in adv
|
|
|
|
|
try this website, there are plenty more out there
http://www.kamalpatel.net/ConvertCSharp2VB.aspx
|
|
|
|
|
sorry but the foll line doesn`t seems to convert
Dim controlQueue As Queue = New Queue(New(){container()})
|
|
|
|
|
Public Shared Function AdvancedFindControl(ByVal Control As Me, ByVal controlId As String) As Control
Dim controlQueue As Queue = New Queue(New()
{
container
}
)
Dim currentControl As Control
While controlQueue.Count > 0
currentControl = controlQueue.Dequeue()
Dim child As Control
For Each child In currentControl.Controls
controlQueue.Enqueue(child)
Next
If currentControl.ID = controlId Then
Return currentControl
End If
End While
Return Nothing
End Function
|
|
|
|
|
This is not valid C# code - you're missing a type name after 'new':
...new Queue(new[] { container });
I would expect something like:
...new Queue(new Foo[] { container });
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Whoa ... posted too soon - this is valid C# syntax - I'm working on the VB equivalent - stay tuned.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Apparently, there is no VB equivalent to an inferred array initialization (e.g., "new[] {...}" in C#3)
The following was produced with Instant VB, with one manual adjustment - adding "Control" after the 'New':
<System.Runtime.CompilerServices.Extension> _
Public Shared Function AdvancedFindControl(ByVal container As Control, ByVal controlId As String) As Control
Dim controlQueue As New Queue(New Control() { container })
Dim currentControl As Control
Do While controlQueue.Count > 0
currentControl = controlQueue.Dequeue()
For Each child As Control In currentControl.Controls
controlQueue.Enqueue(child)
Next child
If currentControl.ID = controlId Then
Return currentControl
End If
Loop
Return Nothing
End Function
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Hi!!
I am using Javascript in user control.. My problem is i am not getting the value of textbox in javascript.
here is my code
function InputChange()
{
var ctl=document.getElementById('txtEmp').value;
alert(ctl);
}
<asp:TextBox ID="txtEmp" onchange="InputChange();" runat="server" CssClass="form_textbox" Width ="80px"></asp:TextBox>
its displaying 'ctl' value as 'null'
please help me ASAP...
Thanks in Advance...
|
|
|
|
|
Its because when you are using User Control or anything ASP genrate a unique client id to every control you are giving wrong i Id i guess
unction InputChange()
{
var ctl=document.getElementById("<%=txtEmp.ClientID %>").value;
alert(ctl);
}
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
modified on Tuesday, April 22, 2008 3:41 AM
|
|
|
|
|
Thanks a lot sandeep... its working.... thank u very much....
|
|
|
|
|
Most likely the id of the control on the emitted page is actually something like: ctl00_master_txtEmp or similar. Look at the source to find this: it is named after the parent element (such as the ContentPlaceHolderID). As an example right click this page, click view source and you will see many examples of this.
Your code would then be:
var ctl=document.getElementById('ctl00_master_txtEmp').value;<br />
alert(ctl);
|
|
|
|
|
Its better to give a client id dynamic instead of static
Check my above modified code that will work
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
I have 2 different database. Both are in mssql. I want code to map tables and columns of these two diferent databases.
Can u please help me?
Thanks and regards,
Arti Khachariya
|
|
|
|
|
|
Hello
how should i add the duplicate url in the web.sitemap file?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
try google first
"Your Web application will fail if you list a URL that does not exist, or if you list a duplicate URL. "
reference = http://msdn2.microsoft.com/en-us/library/ms178418.aspx
|
|
|
|
|
hai
I want to bind DataTextField and DataValueField for dropdownlist in code behind of asp.net application. anybody help..
Regards
M.Ramesh
|
|
|
|
|
I think this can be get from Google
Check google you will find n number of articles that will show this
this is basic, you need to learn how to learn
Let me know if you get any difficulties while implementing this
Atleast show some efforts
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hai friend,
I think that you didn't got my query. ie.if it is dataset means i will bind directly like mydataset.tables(0) like that but I am having data like "1,sandeep|2,Ramesh|3,Akhare". So I need to bind in the dropdownlist using for loop. I need answer for this..
Thanks & Regards
M.Ramesh
|
|
|
|
|
OK Its more simple just create a IDictionary with key values and bind that one to your drop downlist in page_init event like this
public class Test
{
public static IDictionary GetBusinessStates()
{
IDictionary StateTable = new System.Collections.Specialized.OrderedDictionary();
StateTable.Add(" ", "Select One");
StateTable.Add("Sa", "Sandeep");
StateTable.Add("Ra", "Ramesh");
StateTable.Add("Ak", "Akhare");
return StateTable;
}
}
Write this in Page_Init
DropDownList1.DataSource = Test.GetBusinessStates();
DropDownList1.DataTextField = "Value";
DropDownList1.DataValueField = "Key";
DropDownList1.DataBind();
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|