|
I dont see any problem with that too:
<ul>
<li>To Access Google, click <a href="http://google.com">here</a></li>
<li><a href="http://bing.com">This</a> takes you to Bing</li>
</ul>
|
|
|
|
|
It seems to work well in the .aspx, but now I have to put it in as a dynamic variable. Is there any issue with including the a href in the string?
WHEELS
|
|
|
|
|
Depends on how you put the 'href' within that string. As long as the correct html is rendered, you shouldn't have any problem. Can you care to show me your entire code that renders the output?
|
|
|
|
|
<ul>
<li id="liBullet" />
<li><a href="http://bing.com">This</a> takes you to Bing</li>
</ul>
C#
protected System.Web.UI.WebControls.ListItem liBullet;
this.liBullet.Attributes.Add(BULLETTHREELBHL);
private const string BULLETTHREELBHL = "Employee earnings can be submitted through the <a href=\"/EECHG/FW_DEFAULT.ASPX?Serviceid=EECHG&title=Employee+Changes\">Employee Changes</a> service by a plan administrator with access to update employee changes.";
WHEELS
|
|
|
|
|
Attributes.Add() method takes 2 arguments, this code shouldn't compile at all. You should ideally be using ListItem.Text property to render your output.
|
|
|
|
|
When I dynamically populate the .text property, I get an Object reference not set to an instance of an object error. System.NullReferenceException.
|
|
|
|
|
Can you show the code here?
|
|
|
|
|
protected System.Web.UI.WebControls.ListItem liBullets;
private const string BULLETTHREELBHL = "Employee earnings can be submitted through the <a href=\"/EECHG/FW_DEFAULT.ASPX?Serviceid=EECHG&title=Employee+Changes\">Employee Changes</a> service by a plan administrator with access to update employee changes.";
this.liBullets.Text = BULLETTHREELBHL;
<ul>
<li id="liBullets" />
<li>To Access Google, click <a href="http://google.com">here</a></li>
<li><a href="http://bing.com">This</a> takes you to Bing</li>
</ul>
|
|
|
|
|
so, does this throw some exception or it renders the text with the tags ?
|
|
|
|
|
I have to declare the id, and protected System.Web.UI.WebControls.ListItem liBullets; is incorrect. That appears to be reserved for drop-down or list boxes. I'm not sure what type the is to be decalred as.
|
|
|
|
|
You should have told this earlier, try this:
System.Web.UI.HtmlControls.HtmlGenericControl liBullet = new System.Web.UI.HtmlControls.HtmlGenericControl("li");
|
|
|
|
|
What property do I use in liBullet? There doesn't seem to be a text property, and innertext didn't work.
|
|
|
|
|
innerText should work, what do you mean by didn't work? you mean nothing was rendered?
|
|
|
|
|
The bullet rendered, but nothing else.
|
|
|
|
|
|
Thanks for the help. We'll keeping working on it after the weekend.
|
|
|
|
|
If it's a custom control you need to make sure that you actually render an <a href=...> tag.
|
|
|
|
|
Well in my work, we're trying to do a help button for our toolstrip. The situation is that we found an article here in CodeProject that explains how to emulate a help button, for doing this emulation we import a dll and add some code in the event "when click()" the code is this one:
helpbtn.Capture = true;
SendMessage(this.Handle, WM_SYSCOMMAND, (IntPtr)SC_CONTEXTHELP, IntPtr.Zero);
The problem with the code is that only works with a simple button not a toolstripbutton, 'cause the property .Capture is only for simple buttons. We had also try to add the code to a simple button and then use PerformClick() but the toolstripbutton keeps doing nothing. Can anyone help us please?
C#
|
|
|
|
|
You could try setting the .Capture property of the help button's parent ToolStrip and see if that gets you further.
/ravi
|
|
|
|
|
I'm working on a application that will manage Windows updates for you (asynchronous). Everything is working except it will popup messages to users.
Like when installing Language Packs it will display the installation for that, and if trying to install Internet Explorer 9 it will popup and ask the user to Accept, Ask me Later, or Don't Install.
Is there a way to hide everything and just install it? I've search through Microsoft's pages on this API and can't find it.
Here is where I perform the install. I didn't include any of the code for the callbacks or downloads because it would a huge post which you all probably wouldn't like lol. If you want me to I can.
public static void Install(UpdateCollection installs)
{
if (installer != null || installs.Count > 0)
{
if (updateSession == null)
updateSession = new UpdateSessionClass();
try
{
installer = updateSession.CreateUpdateInstaller();
installer.Updates = installs;
installer.AllowSourcePrompts = false;
installer.parentWindow = null;
WUInstProgress installProgress = new WUInstProgress();
WUInstCompleted installCompleted = new WUInstCompleted();
installCompleted.InstCompleted += new InstCompletedDelegate(installCompleted_InstCompleted);
installer.BeginInstall(installProgress, installCompleted, null);
}
catch (Exception ex)
{
ReportError(ex.ToString());
}
}
else
ReportLog("Install collection was null or empty");
}
|
|
|
|
|
I don't believe you can control these prompts since they are coming from the component being installed, which you have access to.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
While I can't help you directly, you can bingle SilentInstall for those apps/components if any such options.
Another possible way would be robocopy or the likes. Good Luck.
For instance take a look here or herefor a silent or unattended install of .net framework 4.
They(MS) say it's like this: dotnetfx.exe /q:a /c:"install /q"
Or just search for it yourself. My bingle foo is pretty low.
All the best,
Dan
modified on Wednesday, July 13, 2011 12:57 PM
|
|
|
|
|
But that isn't using the windows update API.
The problem is I'm not exactly sure how or if it is possible to tell using the API which updates require a users input. If it does require a user input I could set it as needed to be manually installed and skip it or fire off another script to manually download the files and run it silently.
|
|
|
|
|
Ahhh I over looked it:
http://msdn.microsoft.com/en-us/library/aa386492(v=VS.85).aspx[^]
Using IUpdateInstaller2 instead of IUpdateInstaller allows you to forcequiet installs. It doesn't hurt to go through all the references again a few times . I will post back if it worked or not....
*Update*
Worked pretty good! The only thing is the updates will still fail if it is unable to install silently. The one I tested was Internet Explorer 9. At least this gives me the ability to filter them out and not have it pending for a users input.
modified on Wednesday, July 13, 2011 10:20 PM
|
|
|
|
|
cool find.
All the best,
Dan
|
|
|
|