|
Thank alot.. I tried second one, its working
|
|
|
|
|
Hi,
I have a lot of URLS / web programs. I need to create a default page which consist of
two columns. Left column which has link button will call the url and display the existing url to
the right column of my default page. It can be done using html.
Is there a way to do it in .NET version? using web.
Thanks
Dabsukol
|
|
|
|
|
You can use frame to load the url.
Just try following code on click of left column url...
<FRAME src="[url that has been clicked from left column]">
You do not need to think it in .net context. You can do it simply
using frame as shown above.
You can do it dynamically using javascript.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Create a left page say "left.aspx" and set target attribute for anchor element with the name of right frame
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="left.aspx.cs" Inherits="left" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<a href="http://www.google.com" target="right">Google</a>
<a href="http://www.w3schools.com" target="right">W3Schools</a>
</div>
</form>
</body>
</html>
create default page with frame and give a name for right frame
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<frameset cols="10%,*">
<frame name="left" src="left.aspx" />
<frame name="right" src="about:blank" />
</frameset>
</html>
|
|
|
|
|
Thanks it works in .NET
Dabsukol
|
|
|
|
|
using JavaScript i want to change color of cell of asp.net grid view
i want once cell click by user it should became red
and if user click same cell again it should became white
how is that possible plz guide me
Regards
|
|
|
|
|
Add OnRowDataBound Event in your gridview
OnRowDataBound="grvDriverList_RowDataBound"
Define RowDataBound event in cs page
protected void grvDriverList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Attributes.Add("onclick","toggleBGColor(this);");
}
}
Add javascript event
function toggleBGColor(obj) {
if (obj.style.backgroundColor == "red") {
obj.style.backgroundColor = "white";
}
else {
obj.style.backgroundColor = "red";
}
}
|
|
|
|
|
Hi guys,
I'm playing with some kind of SMS service which should be automated, and I have already developed an application, which can send AT codes to a device through the Serial port COMx.
Now I want to expand that application a bit, so I from a desktop can send commands to the serial device on the server.
So PC1 can access Server1 (with serial device connected to com1) provided they are connected in same network.
Is it possible to make some C# code in a desktop application, which connect to a serialport on another machine? In this case the remote server. And how?
|
|
|
|
|
grmihel2 wrote: Is it possible to make some C# code in a desktop application, which connect to a serialport on another machine? In this case the remote server.
I don't think it is possible to connect directly to another PC's serial port via a lan connection. You will probably need some program on the server that takes commands from your client PC and forwards them to the COM port.
It's time for a new signature.
|
|
|
|
|
I'm affraid that you are right about that. I ended up with using a web service hosted on the com hosted server, and then call the get HTTP request needed in URL form to send message. Using webBrowser object in my desktop application (without opening it visually ofc), and it seems to work this way. Then there is just a request about keep the webhosting service running on the server.
|
|
|
|
|
The other question is does it work with multiple clients at the same time??
|
|
|
|
|
I doubt that the webpage request from the server is thread safe. Since its an sms service, it will overflow the GSM modem with AT commands, if there isn't a short sleep timer. But in my case it doesn't matter, since there is no concurrency problem in this case, which means there is only one person at time sending commands by using this service.
|
|
|
|
|
No, it's not. That's the point of the question. If you had more than one person hitting the service at the same time, one instance would get access to the serial port and the other would throw an exception that the port is busy. The question is how does your service code handle that little problem.
|
|
|
|
|
Hi guys
I'm quite new to c#
I'm writing a little jobby to spit the contents of a SqlDataReader out into an HTML table as a string.
How can I find the datatype of each field in the data reader so that I can format it correctly? (dates, money etc)
Thanks
If your wife wants to learn to drive, don't stand in her way...
|
|
|
|
|
SqlDataReader.GetDataTypeName : Gets a string representing the data type of the specified column
|
|
|
|
|
Try...
dataReader1.GetFieldType(0)
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Unsy wrote: a little jobby
You're not in Scotland, are you?
This has quite a different meaning there. Although it's usually referred to as 'a wee jobby'.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
Hi Im pretty new at C# (and also new here!). I am working on a form with a listbox with Multisimple selection mode. Problem is when i select the files, I want the file selection to be in the order of selection
eg
lets say i have item '1', '2', '3' in the listbox
'1'
'2'
'3'
i want to select '3',then '1' and lastly '2' but the items in listBox1.SelectedItems are always stored in '1''2''3'.
Thanks in advance
|
|
|
|
|
The ListBox will not keep track of your selection order; all it keeps track of is the selected state for each of the items; as a result SelectedItems will enumerate the selected items in their order of appearance.
You need to implement your stuff yourself; just keep your own chronological list of selected items, wire up the SelectionChanged event, and adapt your list accordingly every time the selection changes; remember an item can be removed from the selection too!
|
|
|
|
|
Luc Pattyn wrote: The ListBox will not keep track of your selection order; all it keeps track of is the selected state for each of the items; as a result SelectedItems will enumerate the selected items in their order of appearance.
You need to implement your stuff yourself; just keep your own chronological list of selected items, wire up the SelectionChanged event, and adapt your list accordingly every time the selection changes; remember an item can be removed from the selection too!
thanks for the reply. I tried to keep a list of selected items, but listbox1.selecteditem wont return the current selected item (ie lets say i selected '3' and then '1' and then '2', then listbox.selecteditem will always return '1' cause its the first in order)
|
|
|
|
|
yes, you need to compare all entries in SelectedItems with your private list and adapt the latter.
BTW: it will not be a nice GUI that takes order into account but does not show the order at all! One way to solve that is by moving the items around (moving the item selected last above the topmost unselected one), but I would hate to use that too, as I don't like a GUI with moving objects.
|
|
|
|
|
thanks, will give it a shot
|
|
|
|
|
I'm creating a new program. The ONLY thing which is important for me is the running time of the program. Should I use a regular expressions, or maybe should I write my own search code?
|
|
|
|
|
Without knowing what you are trying to achieve, it's hard to give any answers. I will say that a well designed regular expression will generally be faster than a roll your own search and replace algorithm, but a badly designed one can really kill performance when applied to large a data set. If, however, your search/replace doesn't naturally fit into a regular expression don't worry about it. Far too many times, people will contort themselves to write hugely complex regular expressions when a simple string.Replace would have sufficed.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
A regex may win when it involves a complex operation that fits well with a regex approach; OTOH most of the time regexes are both more cryptic and slower than a few explicit string operations. I once performed this experiment[^].
|
|
|
|