|
sorry for let response as i was left the office.
download the ajax control toolkit and give referenct it into your project.
put this line in aspx page at 2 line
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
now simillar to <asp:Label> you will get the <cc1:CalendarExtender> .
for details of using you can also refer my previous reply and you will get that how to use it.
its very simple.
hope this is fine for you.
let me know if you have ant doubts still.
Regards
Keyur Satyadev
|
|
|
|
|
This DatePicker Control[^] is a really easy to use (free!) control. Just put it in an AJAX UpdatePanel and it should do want you need.
Hope that helps.
|
|
|
|
|
no need to datepicker, i need code.....
|
|
|
|
|
hello
There is challenge with me in master page. In the master page i have two ContentPlaceHolder. In ContentPlaceHolder1 has SearchButton and ContentPlaceHolder2 has gridview to bind result. Event fires and datasource is showing data but html is not rendering.
So please give me solution to over come this issue.
|
|
|
|
|
Please let me know how you rebind the 2nd Content page ?
Every time the page processes, will rebind every control in each of those content pages. So If you have correctly bind data after you set the proper DataSource, you should see the Grid with data.
Please show us your code before we can help.
|
|
|
|
|
Hi,
I want to add a functionality in my application that whenever any exception comes an email should be send to a programmer mentioned in web.config file. One way to achieve this is create a function and calling in every catch block in the application. Is there any other alternative so I dont have to call the function in every catch block and an email will be sent as exception comes.
Thanking all
Rock Star
|
|
|
|
|
Make class in App_Code Name "ErrorLog.cs".
Make Public Fn WriteError(string ErrorMsg)
Put your Email Send code here.
call this method in every catch block.
i.e.:
catch(Exception ex)
{
this.WriteError(ex.Messege);
}
!- F - R - I - E - N - D - S -!
|
|
|
|
|
I thought over it.
But there are many catch blocks in the application.
Is there any other solutions except writing it in every catch block.
Rock Star
|
|
|
|
|
you can make your own exception handler for handling exception. but i think class file is a better solution for your problem.
!- F - R - I - E - N - D - S -!
|
|
|
|
|
How can I make my exception handler?
So I dont have to call function in each catch block.
Rock Star
|
|
|
|
|
In Global.asax File,
<script language="C#" runat="server">
void Application_Error(object sender, EventArgs e)
{
//get reference to the source of the exception chain
Exception ex = Server.GetLastError().GetBaseException();
//Insert email notification code here...use ex
}
</script>
In your code
Catch(Exception ex)
{
throw ex;
}
!- F - R - I - E - N - D - S -!
|
|
|
|
|
Thanks for your help
I'll try this code.
Is it possible to retrieve the page name in Application_Error event in global.asax file so developer will aware of in which page error is occurred.
Rock Star
|
|
|
|
|
u can use ex.Messege, ex.Source properties. see all properties. in Global.asax.
!- F - R - I - E - N - D - S -!
|
|
|
|
|
Thanks for your help.
Rock Star
|
|
|
|
|
Have a look at NLog[^].
I believe that will give you what you want.
|
|
|
|
|
Nope I don't want any application for this task I want to write a code for it in my application
Thanks for your help
Rock Star
|
|
|
|
|
You can audit you errors in catch block and use SQL mailing option to send mail
|
|
|
|
|
Thanks but I am looking for sending mail on any kind of exception not only database connectivity exception. Thanks to adkalavadia I got what I wanted.
Rock Star
|
|
|
|
|
|
I just want to extend the functionality. Like these days we usually have more than one application in a single project solution. If I got error on any application within same solution how can we capture this bug, instead of writing same code in each application's global.asax file.
Thanking You!
Rock Star
|
|
|
|
|
Hello. I'm building some management page that should allow change profiles for users.
Web config looks like this:
<profile enabled="true">
<providers></providers>
<properties>
<add name="InstanceIDs" type="string" serializeAs="String"/>
</properties>
</profile>
Then I need to load some user's profile, change property and then save. I do the following:
ProfileCommon PC = (ProfileCommon)ProfileCommon.Create(UserName.Value, true);
PC.InstanceIDs = "1,2,3";
PC.Save();
Nothing happens. The profile was not saved or updated.
May be important. The database table aspnet_Profiles has only one row. For my logged in user. Save for logged in users in other cases works. For manually created profiles Save doesn't make a sence.
My best regards
|
|
|
|
|
Hi All,
I need help regarding Javascript in asp.net.
According to my requirement,we have to create a toolkit which is in one usercontrol and if we click on one control of the Toolkit.It shud add the control to the Container i.e.,Div of the Page,in which we are using this Toolkit Usercontrol,and User wants to add more than one control of same type then it should increment ID's of control automatically Like if Useradded one control then ID will be label1 if he adds another one then it will be label2 and so on.
Please I need this help ASAP.Can any one help me?
Thankyou In Advance
|
|
|
|
|
I think you need to clear out the basics on how ASP.NET works.
Using Javascript, you can create any html control and add it to a div container. But that doesnt means it will automatically added to the server. If you want it to be added to the server you need to postback the page and add the control. You will find each control inside Request.Form collection.
|
|
|
|
|
Thanks For ur reply Abhishek..
I know how to do that in server side but according to our requirement No postback shud happen in the page.As I dont know ways that how we have to do that using only javascript, i posted here ok.It doesnt mean that I dont know ASP.NET.if you know try to reply with better ways to get the solution without any postbacks just tell me.Remind that NO one is efficient as they think themselves ok,Even you.
If you dont know solutions then you dont reply ok
|
|
|
|
|
getaccessyr wrote: Remind that NO one is efficient as they think themselves ok,Even you.
I agree.... budd..
My suggestion is not meant to make you down. I just wanted to know if you know the basics clear. I have seen lots of people who doesnt knows basics right..
Well, regarding your issue, say you want to add a control in the client side, use this :
function addElement() {
var element = document.createElement('input');
element.id = 'txtbox1';
element.name = 'txtbox1';
element.type = 'text';
var cont = document.getElementById('mydiv');
cont.appendChild(element);
}
This will add a textbox in the client side to a container div element.
Now If you want to detect what value you enter in the client side to this textbox use :
string valueEntered = this.Request.Form["txtbox1"];
Also if you want to control to appear in the client side, add the control to the divelement in the server side also during this postback.
Actually, when postback occurs, the page is recreated in the server side and thus any client side controls that is created will be removed. If you want the textbox again, recreate the TextBox object using
TextBox tb = new TextBox();
tb.Text = valueEntered;
this.mydiv.Controls.add(tb);
I hope you are clear now.
|
|
|
|