|
Can you convert this c# asp.net 2.0 html source code to vb.net please?
CssClass='<%# Eval("DepartmentID").ToString() == Request.QueryString["DepartmentID"] ? "DepartmentSelected" : "DepartmentUnselected" %>'>
|
|
|
|
|
it should be pretty similar
CssClass='<%# (DepartmentID.ToString() == Request.QueryString["DepartmentID"]) ? "DepartmentSelected" : "DepartmentUnselected" %>'>
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
This does not work in vb.net.
May be there should be iif
|
|
|
|
|
Sorry, my bad I misread your post and thought you asked for this to be converted from VB to C# - i now see you wanted th other way round.
So maybe it should use iif which is does like:
iif(condition,trueResult,falseResult);
try:
CssClass='<%# iif(DepartmentID.ToString() == Request.QueryString["DepartmentID"],"DepartmentSelected","DepartmentUnselected") %>'>
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
-- modified at 6:50 Friday 28th April, 2006
|
|
|
|
|
Yes, I am aware of the iif , but can not get the c# code to convert to vb.net
Thanks
|
|
|
|
|
VB uses = instead of ==.
---
b { font-weight: normal; }
|
|
|
|
|
is this ok?
CssClass='<%# (DepartmentID.ToString() = Request.QueryString["DepartmentID"]),"DepartmentSelected" : "DepartmentUnselected" %>'>
|
|
|
|
|
Where did iif go?
---
b { font-weight: normal; }
|
|
|
|
|
yes, I meant:
CssClass='<%# iif((DepartmentID.ToString() = Request.QueryString["DepartmentID"]),"DepartmentSelected" : "DepartmentUnselected") %>'>
Thanks
|
|
|
|
|
You never you colon to separate parameters for other functions. Why would you use it here?
---
b { font-weight: normal; }
|
|
|
|
|
May be it is best if you correct the whole code please.
Thanks
|
|
|
|
|
Did the extemely complicated change from a colon to a comma. Changed the brackets for Querystring to parentheses, as VB uses those.
CssClass='<%# iif((DepartmentID.ToString() = Request.QueryString("DepartmentID")), "DepartmentSelected", "DepartmentUnselected") %>'>
---
b { font-weight: normal; }
|
|
|
|
|
too late guffa posted the answer
Weve both given you different bits of this solution, but there comes a line where you must understand what you are writing, so that you learn. Its part of the learning curve that is learning how to program!
I'll give you another pointer, but i wont write the code for you this time.
The method you are trying to use is called iif . It takes three parameters. 1) The boolean condition to evaluate 2) the required return value if condition evaluates true 3) the required return value if condition evaluates false. These parameters are separated by a comma like this
iif(condition,trueValue,falseValue) .
The last code you posted had a incorrect character used to separate one of these parameters.
Now, that was a hell of alot of typing when i could have just given you the answer in 1 line... i hope you appreciate that!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
-- modified at 9:29 Friday 28th April, 2006
|
|
|
|
|
ok, thanks
|
|
|
|
|
d'oh! this is why i usually dont write code in the VB forum - i'm too used to c#! Strange, in that i coded VB for more years than ive coded c#
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
how can i record voice and store it in files
record from the mic
|
|
|
|
|
|
Hi
I'm trying to auto-uninstall a COM service from componentservices with the help of Regsvcs.exe's /u command, but my code doesn't seem to work.
I have a deployment project, which in CustomAction/uninstall uses af custom install class to, among other things, unistall the service.
I have checked that my assemblypath(see code) is correct. I have tried to run Regsvcs /u from a command prompt, and the result is as expected - the service dissapears from the componentservices. When I use Regsvcs /fc during install via my custom install class it works. The service places itself nicely into componentservices. The only mysterious thing I can observe during the whole uninstallation process is, that the BeforeUninstall event seems to fire very late in the uninstall process.
Can anyone tell me, why this code whont delete the service from the componentservices?
<br />
private string regsvcsPath = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework\v2.0.50727\regsvcs.exe";<br />
<br />
public CustomInstaller()<br />
{<br />
InitializeComponent();<br />
this.BeforeUninstall += new InstallEventHandler(CustomInstaller_BeforeUninstall);<br />
}<br />
<br />
void CustomInstaller_BeforeUninstall(object sender, InstallEventArgs e)<br />
{<br />
try<br />
{<br />
string parameters = @" /u " + this.Context.Parameters["assemblypath"];<br />
ProcessStartInfo psi = new ProcessStartInfo(this.regsvcsPath, parameters);<br />
Process.Start(psi);<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.ToString(), "Uninstall error");<br />
}<br />
}
|
|
|
|
|
i need to recode sound from the mic and paly it when i need
plz help me
it is part of my graduation project
Mayood
|
|
|
|
|
Did you even try searching the articles here?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
HTTP has been In use by the WWW global Information Initiative since 1990 and nowadays It Is one of the most widely used protocols on the Internet
HTTP application have historically allowed three different formats for the representation of date/time stamps (described In RFC 2616)
1. RFC 1123 format, for example
Sun, 06 Nov 2005 08:49:37 GMT
2. RFC 1036 format, for example
Sunday, 06-Nov-05 08:49:37 GMT
3. ANSI C's asctime() format, for example
Sun Nov 6 08:49:37 2005
An Implementation Is not HTTP 1.1 compliant If It fails to understand one of the above date/time formats
Question 1
You are require to write an HTTP 1.1 compliant program to parse a string containing one of the above date/time formats. The program must detect the date/time format automatically based on the Input string and store the result In the following object
Class MyDate
{
public Int day; /*1 to 31*/
public Int month; /*1 to 12*/
public Int year; /*1970 to 9999*/
public Int hour; /*0 to 23*/
public Int minute; /*0 to 59*/
public Int second; /*0 to 59*/
public Int dayofweek; /* 0= Sun, 1=Mon,etc* /
}
Question 2
Develop a program to display the system date/time In the RFC 1123 format(as show In example)
==============================
This is my examination, i don't know how to do hikhik, I am newbie Please help me, thanks a lot.
|
|
|
|
|
We don't do your homework.
If you have a specific problem then post parts of the code where you're stuck.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
rockxuyenmandem wrote: i don't know how to do hikhik
I don't know if I do, as I have no clue what it is.
---
b { font-weight: normal; }
|
|
|
|
|
To be a good programmer you must work hard.
Learn, learn and learn :->
Best regards, Alexey.
|
|
|
|