|
I need to loop through all the colors in System.Drawing.Color. Can anyone give me an example on how to achieve this?
Thanks
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
System.Drawing.Color doesn't implement IEnumarable
You will have to do something like this.
System.Drawing.Color c;
string[] colors = Enum.GetNames(typeof(System.Drawing.KnownColor));
foreach (string color in colors)
{
c = System.Drawing.Color.FromName(color);
}
|
|
|
|
|
Thanks
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi everybody,
I was developing an Windows Application that uses a USB device. To communicate with this device I needed a Handle to my application. That was fairly simple, I just used this.Handle in the Windows Form!
Now I want to build a web service that connects to the same USB device. Therefore, I need a Handle to my web service, but there is no such thing as this.Handle in HttpApplication! There must be a way of getting it, but I can't find it! Can anybody please help me?
Thanks!
|
|
|
|
|
Hi,
I created web application which uses a thrid party webservice.when i run the application, it is encountering the following exception.
"The remote name could not be resolved: "
Please anybody help me to resolve this problem.
Thanks in advance
Narendra
|
|
|
|
|
You should probably double check the value that is in URL when you pass it to Create and make sure that it's the proper value that you think. Also you should make sure that there isn't a firewall that might be blocking the server.
Regards,
Satips.
|
|
|
|
|
I provided the credentials for that webservice. Now it is throwing the below exception.
"The remote server returned an error: (400) Bad Request."
Thanks in advance
Narendra
|
|
|
|
|
Are you trying to load the Assembly from GAC?
Regards,
Satips.
|
|
|
|
|
No iam not loading any assembly explicitly.
Thanks in advance
Narendra
|
|
|
|
|
This Exception is rarely encountered, usually when sync is initiated with either 'Upload, Synchronize with Outlook precedence or Synchronize with Google precedence' operations, for certain recurring events.
This exception is thrown by the Google server when it is not successful in updating or adding certain recurring events in the Google calendar. This intermittent issue has been confirmed by Google and the Google team is working to resolve it.
Being intermittent, mostly this exception disappears when sync is initiated multiple times. Therefore, all the SyncMyCal users who are getting this exception are requested to initiate sync multiple times and see if sync is successful.
Regards,
Satips.
|
|
|
|
|
I have a repeater control that is populated with values from a database every minute. This was done using an AJAX timer and update panel. This all works. What I would like to do is when a new row is added to the repeater control(presumably from someone adding a new row on a copy of the app elsewhere) and it is displayed in the repeater. To find someway of highlighting that row to show it is new.
Breaking it down I need to find someway of recognising that the data in the repeater has been changed, then I need a way of highlighting it. Can anyone help??
I was thinking of possibly attempting to populate a dataset from the data contained in the repeater, then databinding the repeater then reloading the dataset with the changes and calling get changes. But I dunno what I am doing and I can’t get this to work and the only way I know how to use a dataset is with a datadapter which I don’t think will work? I have never used datasets before and I can’t really find much help for it on the msdn. If anyone can tell me how to do this it would be most appreciated.
Cheers
Ian
|
|
|
|
|
Assuming you have control over the database, I'd be tempted to look at adding a "LastUpdated" datetime field to the database table, and then using the OnItemDataBound event to check for this during binding, and highlighting rows that have been updated in the past X mins/hours/whatewver....
cheers
Fred
|
|
|
|
|
Ok then didn't think of it that way!
I have added a column into the table the repeater is created from. the onItemDataBound event is called ItemDataBound? I assume this is the one that you mean? Now sorry to be so dim but I am not sure how I am supposed to get the data in my Column out?
I am using this
<br />
Protected Sub repResults_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles repResults.ItemDataBound<br />
If repResults.Items.Count > 0 Then<br />
e.Item.... ' Dunno what goes here? :-S<br />
End If<br />
<br />
End Sub
Ok then I assume that this is where I put my code to check the time compared to the stored time. Only really want those items created in the last 5 mins to be highlighted. But i am a bit clueless as to how to get my the exact item out and how to then go about highlighting the row(I assume its a case of background.color.)
The other thing is does the even ItemDataBound get called for each cell in the repeater or is it each row? couldn't find that out anywhere?
Thanks for your help so far tho...excellent idea, just wish i could pull it off!
Cheers
Ian
|
|
|
|
|
You'll want something like this in your ItemDataBound event handler:
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim dr As DataRow = e.Item.DataItem.Row, DataRowView
Dim d as Date = CDate(dr("LastUpdate"))
' now compare this time with "Now" and if within appropriate time-frame, highlight row...
End If
It gets called for each row...
How you then highlight the row is another matter...! I'm pretty sure I've seen articles on CP about this... or Google it - the answer is out there...
cheers
Fred
|
|
|
|
|
I have ended up not doing it that way! sorry...
sorry i have left work now so I don't have the exact code in front of me so will prob make a mistake
in the tag in the html on the repeater I have added
>
then in the code behind added a function
<br />
Function highlightNewRow(ByVal dt as String) as String<br />
<br />
' in here i then converted dt to a datetime and got the time as now into<br />
' another variable.<br />
<br />
if (dt_now - dt_dat) < New Timespan(0, 5, 0) then<br />
Return "style='Background:Red;'" 'Realise this is prob wrong, but can't remember what i used in the actual bit I did :)<br />
End If<br />
<br />
Return ""<br />
<br />
End Function<br />
If you want when i get back into work tomorrow I can post the actual code I used.
Thanks for your help tho...it was reading your intial bit about getting the data item back that made me realise I could use the database and do it that way. It was most helpful.
Cheers
Ian
|
|
|
|
|
That's great - it's always good to figure out your own answer! Don't worry about code - I can see what you've done.
cheers
Fred
|
|
|
|
|
Thanks Fred,
I only just started a new job and begun learning asp.net as part of it. Never used it before so its a big learning curve for me. I have to say how great a community this is and how friendly people are on here helping misfits like me out!
Thanks for taking the time Fred.
Cheers
Ian
|
|
|
|
|
Hai,
I'm getting one error warning as "There is no source code available for the current location" at the time of debugging using breakpoint. Due to this error i can't able to open a popup window. I'm using AjaxControlToolkit in my application.
Regards n Thks
Sam.M
|
|
|
|
|
Are u calling a web service somewhere whilst debugging?
I get this error sometimes when calling a web service method.
|
|
|
|
|
I had posted this question couple of days ago but still not able to get the answer. I want to Get HTML by Executing URL on Server. I have got the HTML but problem is this Current Session Values are not being sent. I can't use query string I have to use current sessoin values!!! Any Help will be highly appricated!!!
|
|
|
|
|
Perhaps it would help if you were a little more specific about what you're doing... Are you normally able to read session values on different pages of the same application? If so, what is different about what you're doing in this case?
Fred
|
|
|
|
|
Thanks for ur reply!
Actually my code is!
Dim objWebClient As New WebClient<br />
Dim aRequestedHTML() As Byte<br />
aRequestedHTML = objWebClient.DownloadData(strURL)<br />
Dim objUTF8 As New UTF8Encoding<br />
Dim strRequestedHTML As String<br />
strRequestedHTML = objUTF8.GetString(aRequestedHTML)<br />
GETHTMLStream1 = strRequestedHTML
The request(URL) is sent to the server which returns the HTML. Now Problem is this request doesn't able to retrieve session values.
Session values are being reterieved on other pages.
|
|
|
|
|
Well no, it won't... Session values (SessionID anyway) are passed back and forth between the browser and the server whenever a page is requested - a form of cookie; this is how it knows which session values belong to which client - and just passing the URL to the server won't send the session values too. You'll need to re-think your model....
Fred
|
|
|
|
|
Do you have any suggestion regarding this!!!
|
|
|
|
|
Not really, I'm afraid.. if you really need to do it this way, I guess you'll have to pass the session variables as paramters of the url - if you're worried about security, you'll need to encrypt them first.
Either that, or go back to the drawing board and see if there isn't another way to achieve whatever it is you're trying to do...
Good luck - sorry I cna't be more help...
Fred
|
|
|
|