|
Yes, u can create ur own user control and use that in ur aspx page like other asp controls.
But u have to register ur control (either in each page or in web config).
u can use <%@ Register TagName="tagname" TagPrefix="tagprefix" Src="~/usercntrl.ascx" %>
in top of the aspx page and use ur user control
<tagprefix:tagname id="test1" runat="server">
Hope it helps u
|
|
|
|
|
Thanks for the reply
I know how to create and use the ascx controls but i want to add extra functionality to it
let me try and explain it in another way.
I want to make like for e.g. the asp panel it would be used like this
<asp:Panel ID = "panel1" runat = "server">
<table>
<tr>
<td>
<asp:Button id = "b1" runat = "server" text ="Click Me" />
</td>
</tr>
</table>
</asp:Panel>
now what i want to do is like the same way you use the panel to place something inside , i want to use my custom control
just again , its a popup window and i would like to use some sort of place holder where i can place stuff in
for e.g. i would want to use the window for error messges or to put in a few textboxes and labels.
like this
<tst:mycontrol runat ="server" >
<content>
<table>
<tr>
<td>
<asp:Button id = "b1" runat = "server" text ="Click Me" />
</td>
</tr>
</table>
</content>
</tst:mycontrol>
|
|
|
|
|
If it's a popup, it's a seperate window, not a control.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
sory about the way my posts are looking , they dont display right on my side,
anyways ,
i know its a different window ,
i want to use it with the ajaxmodalpopup extender ,
the way i want to create the control must be like a template of some sorts ,
I'm putting in a label header which can be changed with the control's properties
and then in the middle i want a place holder where i can place buttons or tables and stuff,
like this
<tst:mycontrol runat ="server" id = "tst1" HeaderText = "Error">
<content>
....... (maybe table with message in and a button to click ok)
</content>
</tst:mycontrol>$
|
|
|
|
|
Hi all,
I have a html editor,i bind the value from the DB to the textarea.then i update the binded text and assigned it another variable.But the varible holds the value which is initially binded.I cant save the Updated text from Html editor.
Can any one help me..
|
|
|
|
|
Can you pastered this code? DB it's bind ,and update it.
|
|
|
|
|
Can you post the code? From your question, I doubt whether you are using web application or not. You may be binding the text area control in the page load. Now this binding code may have been written outside if(!IsPostBack) region. So, whenever you are clicking on the update button, postback is happening and control goes to the page load and it si rebinding the old value to the textarea. So, if you are doing so then put the data binding code inside !IsPostback region.
Either you love IT or leave IT...
|
|
|
|
|
Hi experts,
how to create dymamic textboxes using javascript in asp.net without postback
beula.
CMOTS Infotech,
Capital Market.
|
|
|
|
|
Use Google[^]
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
use Javascript friend...
But if then mind that you cannot find that in the server, you need ajax to post data of those controls.
Use :
var elem = document.createElement('input');
elem.type = 'text';
divelem.appendChild(elem); //divelem will be the container which holds the textbox.
|
|
|
|
|
|
Friends
I made a website without master page. And it works fine.
Now i add master page and compiled and tested locally, it works.
But as i upload it on server, it denies.
Than agin i remove that master page and again upload it, it works again.
Wats the problem. Am i doing something wrong or .......????
Help
|
|
|
|
|
masterpage has a content place holder in it .. If you add a masterpage, you must take into account that every control in contentplaceholder will change its identity when rendered in the client.
Please let me know what kind of errors you are getting. If it is related to client side, I think you need to change the javascript codes accordingly for each controls.
We dont have the facility to change the clientId now, it is included in .NET 2010.
So there is no way out to change the id of the controls that will be rendered in client side.
|
|
|
|
|
Oh,there are some OCX on master page, Maybe upload used OCX samed of master page COX.
|
|
|
|
|
What error exactly are you getting on the server?
Either you love IT or leave IT...
|
|
|
|
|
hi everyone!!!
i am using calendar control when i display the calendar i should dispose the previous dates.(or strike off)
sowmya
|
|
|
|
|
Use the day render event to find the dates and then strike out...e.g.
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date < (System.DateTime.Now))
{
e.Day.IsSelectable = false;
e.Cell.Font.Strikeout = true;
}
}
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Its very easy to do that, Just folow:
In your HTML:
<asp:calendar id="Calendar1" runat="server"
ondayrender="Calendar1_DayRender">
And in your code-behind:
protected void Calendar1_DayRender(object source, DayRenderEventArgs e)
{
if (e.Day.Date.Day < DateTime.Today.Day)
{
e.Cell.Controls.Clear();
e.Cell.Text = e.Day.DayNumberText;
e.Cell.BackColor = System.Drawing.Color.SmokeWhite;
}
}
It will Disable any date before today.
Hope you will get it..
|
|
|
|
|
How to add more than one table in a document while creating pdf file
|
|
|
|
|
|
How to add nested tables
|
|
|
|
|
hi, i am using an asp calendar control. i have written code for onSelectedIndexChange for the calendar control. but whenever i click on the calendar control, the whole page is getting refreshed. there is no autopostback property in the calendar control to stop refreshing the page. can anybody help me plz....
scarface
|
|
|
|
|
Can you show the code you have written..?
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
hey, thanks for such a quick reply....
i have a button, which when clicked, opens the calendar(calendar is inside a div whose display is none in the begining. when button is clicked, the display is 'block', so the calendar shows up.) but when a value is selected in a calendar(server control), the whole page is refreshed and the div display is 'none' again. this happens everytime i click on the calendar control....
scarface
|
|
|
|
|
scar_face wrote: when a value is selected in a calendar(server control), the whole page is refreshed
That's the way it behaves...The Calendar control included with ASP.NET uses postbacks only. If you don't want the users to notice it use AJAX update panel and keep the Calender control inside it.(Or else you can write your own javascript calender.There are plenty of them available on the web).
scar_face wrote: and the div display is 'none' again
You need to run the javascript again...You have the register the clientscript and run the script again once the page refreshes.(Or else set the display: block again)
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|