|
I want to create a MessageBox, that I want to
use on many of my web pages.
The MessageBox is a System.Web.UI.UserControl and is an .ascx file.
It contains a table with som labels in it.
Now on my UserEdit.aspx site I've added an asp:PlaceHolder with ID="plhMessage".
At the code behind I want to add a messagebox, something like:
<br />
plhMessage.Visible = true;<br />
MyMessageBox mb = new MyMessageBox();<br />
mb.Type = global::My.Web.Controls.MyMessageBox.EnumMessageType.Ok;<br />
mb.MessageText = "Data was saved.";<br />
plhMessage.Controls.Add(mb);<br />
Now at the command plhMessage.Controls.Add(mb); it goes
in to the protected void Page_Load(object sender, EventArgs e) of
the MyMessageBox control. But when I look at any of the Label properies it is NULL.
The result is of course that there is no message to view.
What am I doing wrong?
Or is there a better way of doing this in VisualStudio 2005?
(maybe somthing like an asp:Content, asp:ContentPlaceHolder witch I'm using on my masterpage)
I've easely done this with controls of type "WebControl", but then I've had to
create all the items with codelines, and I want the flexability an System.Web.UI.UserControl
gives with reference to design layout.
Thank you.
Thomas
|
|
|
|
|
You can always use javascript it is a little easier.
(.net 2.0)
private void ShowDialog(string p_msg)
{
Type cstype = this.GetType();
StringBuilder tmpSB = new StringBuilder();
tmpSB.Append("<script type=text/javascript>");
tmpSB.Append("alert('" + p_msg + "')");
tmpSB.Append("</script>");
ClientScript.RegisterClientScriptBlock(cstype, "Save", tmpSB.ToString());
}
Ben
|
|
|
|
|
You can't use MessageBox in ASP.NET applications. You'll have to resort to javascript alert or confirm or create your own popup.
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
I am developing Asp.net 2.0 website. All the linkbuttons in my website does not defaultly change the color after visiting. Even I tried to use this common CSS property
a:visited
{
color: #800080;
}
a:link
{
color: #0000FF;
}
a:active
{
color: #0000FF;
}
It is not working. Please help me.
Thanks
Mohamed
|
|
|
|
|
Put the pseudo classes for links in this order:
:link<br />
:visited<br />
:hover<br />
:active
---
single minded; short sighted; long gone;
|
|
|
|
|
Howdy All:
I have a ASP.NET 2.0 "content" page derived from a custom "Base Page" class based on the System.Web.UI.Page class.
The "Content" page has a placeholder control that I want to get a reference to in the "Base Page" class.
I have tried FindControl() but it doesn't seem to find it.
Any ideas?
Thanks for any help.
- The Trooper
|
|
|
|
|
Why can't you just expose the control ? Are you castng the page to the correct type ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Friends, i am in a problem in my project i want to convert runtime xmldocument( document is not stored in physical path it will generted from the code) i want to convert that into memory stream.
please anybody help me.
regarda
alex
|
|
|
|
|
Hello!
this is ravi, i am trying to edit the form view control but i am unable to do that. i don't want to use sqldatasource control.I want to handle the events in code behind file.
|
|
|
|
|
I have a custom control inheriting from a GridView. That gridview already has items in its smart tasks list. I want to add a few to that list. I created a class inheriting from System.Web.UI.Design.ControlDesigner and a helping DesignerActionList class. I set the designer attribute on my control's class as such [Designer(typeof(MBGridViewDesigner))] which does get my item on to the list, but it wipes out all the existing items. If there a way for me to simply add my new items to the existing list?
|
|
|
|
|
|
|
In Javascript u can Get URL of Current Location as
window.location();
assign to var winLoc;
U Can Get WinLoc as www.test.net/Add.aspx?fsrno=3
Now Find the Find THe IndexOf "=" in Above String because this is unique
and Split string as subString after position "="
THen U can Get QueryString
Hard To Say
|
|
|
|
|
Hi,
I am needing help with URL rewriting. I have not found a good article on the Internet. If any one knows of a good article please let me know. If any one can help with advice please let me know.
/2007/09/23/microsoft-passes-the-openajax-interopfest-test.aspx
This example URL was taken from a blog. This is what I am after.
Regards
|
|
|
|
|
hi i need search engine in my site..
so how can i use google search engine in my site
thxxx
Ajay Rathi
software engineer
NOIDA(UP),INDIA
|
|
|
|
|
|
|
hi friends,
i want paging with repeaters,can anyone of u help me to solve this problem..
thx
Regards
Ajay Rathi
software engineer
NOIDA(UP),INDIA
|
|
|
|
|
You need to write a control to handle this yourself, or look for one in the articles on this site.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how i can set image control left position to a given value in asp.net
|
|
|
|
|
Use stylesheets.
Set the position property to absolute, and the left to a certain amount of pixels..
<br />
style="position: absolute; left: 10px;"<br />
-- edit --
I see the property names are replaced in the example code... Anyway, the first property is position, the second is left
-- end edit --
|
|
|
|
|
Hi,
Am I sending this XML to a SP in SQL:-
<?xml version="1.0" encoding="utf-8"?><Entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Entity><ID>5a939ee4-37ef-416f-b658-04b5c759d065</ID><Type>OWNSITE</Type><Name>125 NAS2</Name><ImportCode>00125E</ImportCode></Entity></Entities>
Although it seem that SQL 2005 doesnt like encoding="utf-8"
I am creating this xml by running a Serialize method in my EntityCollection, by using the following code:-
public string Serialize()
{
return XMLUtil.SerializeClass(this, GetType());
}
Before a pass this XML in the DAL to the SP I am trying to replace encoding="utf-8" with string.empty, with not to much success.
Just wondering that's the best way around my problem, should I try & replace with empty string, or should I not have it there in the first place?
Either way, I'm not sure how to do this in code.
Anyone any ideas?
Many thanks
janet
Lady Programmers are a rare breed!
|
|
|
|
|
try to change the Ecoding property to different one
i am not sure but using xmlwriter in setting you have Encoding property try to give different one
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... "
|
|
|
|
|
But_Im_a_Lady wrote: Am I sending this XML to a SP in SQL:-
Are you storing this XML in a table ?
But_Im_a_Lady wrote: Although it seem that SQL 2005 doesnt like encoding="utf-8"
What error you got ?
|
|
|
|
|
no Im not storing this XML directly into a table.
I am passing two lots of XML into the SP, as 2 separate param's, where the data will be stored in various tables.
The error that I get is:-
Msg 9402, Level 16, State 1, Procedure ksspnapp_SetProperties, Line 0
XML parsing: line 1, character 38, unable to switch the encoding
Lady Programmers are a rare breed!
|
|
|
|