I am trying to change the text of ASPxPopupControl buttons (I have not written the ASPxPopupControl code myself. Those guys are long gone. :) So it's up to me). As far as I know, the ASPxPopupControl default buttons are used and if I want to change the button text I have to add code to the .aspx file. I have tried searching for an answer on the DevExpress docs and the world wide web. But could not find anything that matches my needs. I am very grateful for any ideas.
This is the buttons I am talking about:
The ASPxPopupControl code (There is an attempt to add a custom button but it does not work.):
<dxpc:ASPxPopupControl ID="someLongID" runat="server"
AllowDragging="True" ClientInstanceName="someLongID"
CloseAction="CloseButton" HeaderText="Varning!" Modal="True"
PopupHorizontalAlign="WindowCenter"
Width="300px">
<ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl3"
runat="server" Enabled="True">
<p>
<br />
</p>
<p align="right">
<input
id="Button1"
onclick="javascript:someLongID.Hide();"
type="button" value="Stäng" />
</p>
</dxpc:PopupControlContentControl>
</ContentCollection>
<HeaderStyle BackColor="#FFB6C1" />
</dxpc:ASPxPopupControl>
If you don't implement you own popup edit form, but use the built-in one, it is necessary to access the required text setting via the ASPxGridView.SettingsText (CommandUpdate, etc.).
I think you can change the text content in the item property (in "Properties") which is located in the right down corner on VS.
you can click on the item in "Design" mode and then check its setting in "Properties"
Hope this helps
Related
why button of text editor for AjaxControlToolkit not working with me like
color font - size only drop down worked ok
but others one can't uses
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
<label class="control-label">Enter Title News</label>
<asp:TextBox ID="Title1" CssClass="form-control" runat="server"></asp:TextBox>
<br />
<label class="control-label"> Content News</label>
<cc1:Editor ID="Editor1" runat="server" />
You must use TargetControlID like that
<cc1:Editor ID="Editor1" TargetControlID="Title1" runat="server" />
I think I understood your problem.
Open this link: HTML Editor Sample
You say you try to change the font-color and background pressing the control buttons. Those buttons work when you select the text first.
Type something into the Editor, then select that text.
After that press the font-color change button. It should turn you text into another color.
It works the same way with the background.
Also, if you press the button, then star typing, your text should start showing the color. (Works exactly like Word)
problem was when page load the editor tool and when i want post content
if when i press on button there is not working like (fore color , insert link )
This problem was due to my use bootstrap because when i create new web form and include the editor it's working fine and all the buttons can press and uses
Thank you for helping me
I have been trying to get a Modal Popup to work for the last few months. I try and try, and after a while I just give up and find another way to work around it. I am very new to programming and have been doing some helpful things for my department, but in order to make these things viable alternatives I need to get more functionality out of them.
I want to be able to update a row in my SQL server, but the gridview is pulling data from a View, so the built in edit options won't work for me. I was hoping to be able to have a Modal Popup appear on the screen so that I can have the user put the data in and it will build the proper SQL statement to update the row.
I can't even get a Modal Popup with a single line of text to 'popup' though.
At the top of the page I have this:
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
Then in my main div I have this:
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat=server"></cc1:ToolkitScriptManager>
Then down in the body I have this:
<asp:Button ID="btnTest" runat="server" Text="Test" />
<cc1:ModalPopExtender ID="mp1" runat="server" PopupcontrolID='pnlEdit" TargetControlID=btnTest" OkControlID="btnSubmit" CancelControlID="btnClose" BackroundCssClass="modalBackground" ></cc1:ModalPopupExtender>
<asp:Panel ID="pnlEdit" runat="server" style="display:none">
<div class="modalPopup>
<p>Text goes here.</p>
<asp:Button ID="btnSubmit" runat="sever" Text="Submit" />
<asp:Button ID="btnClose" runat="sever" Text="Close" />
</div>
</asp:Panel>
Code Behind currently has nothing for this. I have tried the same code with the variation of giving the btnTest an OnClick that does mp1.Show();. And also tried adding a "dummy" TargetControlID that is rendered but not shown in order to use the Code Behind to fire.
Every variation produces the same results. The "Test" button is clicked and then nothing happens. It appears that the page is reloaded. What am I missing here?
Please take a look at this Solution
This is the code and css i have checked several links and followed accordingly but i still get the problem. Kindly explain.
<asp:Button ID="Button1" runat="server" BackColor="#93C323"
Font-Names="Segoe UI Light" Font-Size="X-Large" ForeColor="White" Height="41px"
style="margin-left: 144px" Text="+ Add" Width="121px" />
.button:hover
{
background:#DBDBDB;
}
Avoid to make the style inline when you like to change it by hover, or dynamically. This is an example that I just tested and is working:
<asp:Button ID="Button1" runat="server" CssClass="OneButton" Text="ok" />
<style type="text/css">
.OneButton
{
background-color:#93C323;
font-size:x-large;
color:White;
height:41px;
width:121px;
margin-left:144px;
}
.OneButton:hover
{
background-color:#DBDBDB;
}
</style>
And a live version of it: http://jsfiddle.net/gwSWy/
You need to add cssclass="button" to your button.
<asp:Button ID="Button1" runat="server" BackColor="#93C323" CssClass="button"
Font-Names="Segoe UI Light" Font-Size="X-Large" ForeColor="White" Height="41px"
style="margin-left: 144px" Text="+ Add" Width="121px" />
If you're looking to do this globally for all buttons:
The ASP.NET button creates <input type="submit">.
So you'll need to style around that.
If you just need that style with your button, you can use the Button Property CssClass. Check this link for your reference.
and one thing more, I guess you're not using style properly. you can just put your margin details in the button css then remove the attribute style.
Your CSS rule will not find the element in the DOM because there is no CSS class assigned to it the way you are doing it.
You can do as nimeshjm mentioned and add the CssClass="button" attribute to the button control - this should match your CSS rule assuming you don't have any other problems (stylesheet is linked to on the page, no over-riding/more specific rules.
You also won't be able to style the element based on its ID because it will be automatically changed when the page is rendered to prevent ID collisions between elements.
If you use the attribute ClientIDMode="Static" which will keep the ID as you specified in the control.
As Joe Enos stated, the Button control is rendered as an <input type-"submit" /> so you also can't use an CSS rule like button:hover { background: black; }
Is there a way to have an AJAX CollapsiblePanel drop down and hover over the other elements on the page without resizing things?
Right now, I have:
<asp:Button ID="TriggerButton" runat="server" />
<asp:Panel ID="CollapsiblePanel" runat="server">
</asp:Panel>
<asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender" runat="server" TargetControlID="CollapsiblePanel" Collapsed="true" AutoCollapse="false" AutoExpand="false" ExpandControlID="TriggerButton" CollapseControlID="TriggerButton">
</asp:CollapsiblePanelExtender>
Thanks for any help.
Out of the box there is no option as far as I am aware but I'd make a guess you could probably do something by using css and setting the z index of the panel and surrounding controls .. my css isn't great though when it comes to positioning so sorry I can't give any examples.
EDIT:
Try this: http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23761881.html
(if you don't have a experts exchange membership scroll right to the bottom of the page and the answer is displayed!)
I am using a button that has to be invible and should be used by a javascript function.
<asp:Button ID ="btnDummy1" runat="server" Visible ="true" OnClick="btnSubmit1_Click" width="0px" height="0px"/
I cannot keep visible = false as it the javascript will not use invible content in the poage. I havetried to give width=0 and height=0, still it showws up in Chrome. What do you guys think i should do?
Thanks in advance :)
A pretty clean approach in ASP.Net it give it a "hidden" class:
<asp:Button ID ="btnDummy1" runat="server" CssClass="hidden" />
Then in your stylesheet:
.hidden { display: none; }
If you set it to Visible="False" then the code will not be executed.
Instead I think you should wrap it in a <div> and set display:none via css:
<div style="display: none;">
<asp:Button ID ="btnDummy1" runat="server" OnClick="btnSubmit1_Click" />
</div>
adding style="display:none" would hide the button till you make it visible again
<asp:Button ID ="btnDummy1" runat="server" OnClick="btnSubmit1_Click" style="display:none"/>
How about
style="display:none"
for the button instead of Visible = "true".
Can you just use a hidden form field in this case? This is generally the preferred method of passing information along.
See http://www.tizag.com/htmlT/htmlhidden.php
<asp:Button ID="btnMyOrders" runat="server" Text="my orders" CssClass="dropdown-item" OnClick="btnMyOrders_Click" Visible="False" />
Example then in Form(){
btn.Visible = true; to show it again
}
I think the first question you should ask yourself is : why would I put in my HTML doc a button that should not be visible ?
An HTML document should be used ONLY TO DESCRIBE A CONTENT'S SEMANTICS. So an HTML doc should ONLY contain the content you want to publish and extra data to explain the content's SEMANTIC !! NOTHING about the way it is displayed, NOTHING about the way it behaves !!
All displaying and behaviors questions should be managed with CSS and Javascript, NEVER within HTML itself.
Any element needed for Javascript only purpose should be added in the doc by Javascript itself !
You should never find, in an HTML doc, such things as prev/next buttons for a javascript picture gallery for example. The HTML doc should only contain the pictures list, than your JS script will change the way this list is shown, making it a eye candy gallery and add buttons for navigation.
So in your example, your saying you want to add in your HTML doc an invisible button with some Javascript actions on it.... that's probably an example of some content that should never be in the HTML doc.