now you are able to debug your silverlight application using debugger. this post me be useful to you.Thanks for reading stayed turned for more.
Thank You
Kirti Darji
<asp:ScriptManager id="scriptManager" runat="server" EnableHistory="true" OnNavigate="scriptManager_Navigate"> </asp:ScriptManager>Now parent page contain scriptmanager as well as tabcontainer control.and child page(User Control) contain tabcontainer control.now one thing you notice there we use one script manager for both page so how can we get script manager on child page(User Control).To achieve this we have to define one property for script manager on child page(User Control) and add Event handler for onvavigaet event of script manager when initializecomponent of child page(user control).following is code for that in Child page(user control)
private ScriptManager scriptManager { get { return AjaxControlToolkit.ToolkitScriptManager.GetCurrent(this.Page); } }Add event handler for onnavigate vent for scriptmanager using
override protected void OnInit(EventArgs e) { InitializeComponent(); } private void InitializeComponent() { scriptManager.Navigate += new EventHandler<HistoryEventArgs>(scriptManager_Navigate); }now on OnActiveTabChanged Event of ajaxtabcontainer of parent page we make a code for save history point in collection using addhistorypoint method of scriptmanager. we have save history point for both pages mean Parent page which contain Tab1,Tab2 and Tab3 and Child page(User Control) means its contain Child1,Child2,Child3 and Child4 etc. and one child page we can say one user control is there on Page. So we can achieve out goal for saving history by save history point value with tabcontainer name. so for that we make below code on ActiveTabChanged event of tabcontainer on parent page as well as Child Page(User Control)
protected void ajxTab_ActiveTabChanged(object sender, EventArgs e) { if(scriptManager.IsInAsyncPostBack && !scriptManager.IsNavigating) { scriptManager.AddHistoryPoint("historyPoint", string.Format("{0}#{1}","ajxTab", ajxTab.ActiveTabIndex.ToString()),ajxTab.ActiveTab.HeaderText); } }Child Page(User Control)
protected void subajxTab_ActiveTabChanged(object sender, EventArgs e) { if (scriptManager.IsInAsyncPostBack && !scriptManager.IsNavigating) { scriptManager.AddHistoryPoint("historyPoint",string.Format("{0}#{1}","subajxTab",subajxTab.ActiveTabIndex.ToString()), subajxTab.ActiveTab.HeaderText); } }when browser back button is clicked scriptmanager Navigate event is fire so we can check on scriptmanager navigate event if historypoint is not null then set activeTabIndex for that tab.this scriptmanager navigate event is implemented on both page parent and child page(User Control) if parent page ajax tab name we found after splitting historypoint value then we set parent page tabcontainer control activeTabIndex else child page (User Control)activeTabIndex index following is code is for scriptmanager Navigate event for both page.
protected void scriptManager_Navigate(object sender, HistoryEventArgs e) { string state = e.State["historyPoint"]; if (state != null) { string[] arrstring = state.Split('#'); if (arrstring[0] == "ajxTab") ajxTab.ActiveTabIndex = Convert.ToInt32(arrstring[1]); } else ajxTab.ActiveTabIndex = 0; }
void scriptManager_Navigate(object sender, HistoryEventArgs e) { string state = e.State["historyPoint"]; if (state != null) { string[] arrstring = state.Split('#'); if (arrstring[0] == "subajxTab") subajxTab.ActiveTabIndex = Convert.ToInt32(arrstring[1]); } else subajxTab.ActiveTabIndex = 0; }I tried my best to explain this in detail if any one could to get some point please feel free to contact me by putting comment I will try my best to explain as soon as possible.Thank You for reading. Stay Turned for more.
static class NumberToWord { private static string[] _ones = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; private static string[] _teens = { "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" }; private static string[] _tens = { "", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" }; // US Nnumbering: private static string[] _thousands = { "", "thousand", "million", "billion", "trillion", "quadrillion" }; ////// Converts a numeric value to words suitable for the portion of /// a check that writes out the amount. /// /// Value to be converted ///public static string Convert(decimal value) { string digits, temp; bool showThousands = false; bool allZeros = true; StringBuilder builder = new StringBuilder(); // Convert integer portion of value to string digits = ((long)value).ToString(); // Traverse characters in reverse order for (int i = digits.Length - 1; i >= 0; i--) { int ndigit = (int)(digits[i] - '0'); int column = (digits.Length - (i + 1)); // Determine if ones, tens, or hundreds column switch (column % 3) { case 0: // Ones position showThousands = true; if (i == 0) { // First digit in number (last in loop) temp = String.Format("{0} ", _ones[ndigit]); } else if (digits[i - 1] == '1') { // This digit is part of "teen" value temp = String.Format("{0} ", _teens[ndigit]); // Skip tens position i--; } else if (ndigit != 0) { // Any non-zero digit temp = String.Format("{0} ", _ones[ndigit]); } else { // This digit is zero. If digit in tens and hundreds // column are also zero, don't show "thousands" temp = String.Empty; // Test for non-zero digit in this grouping if (digits[i - 1] != '0' || (i > 1 && digits[i - 2] != '0')) showThousands = true; else showThousands = false; } // Show "thousands" if non-zero in grouping if (showThousands) { if (column > 0) { temp = String.Format("{0}{1}{2}", temp, _thousands[column / 3], //allZeros ? " " : ", "); allZeros ? " " : " "); } // Indicate non-zero digit encountered allZeros = false; } builder.Insert(0, temp); break; case 1: // Tens column if (ndigit > 0) { temp = String.Format("{0}{1}", _tens[ndigit], (digits[i + 1] != '0') ? "-" : " "); builder.Insert(0, temp); } break; case 2: // Hundreds column if (ndigit > 0) { temp = String.Format("{0} hundred ", _ones[ndigit]); builder.Insert(0, temp); } break; } } // Append fractional portion/cents builder.AppendFormat(" DOLLARS and {0:00} / 100", (value - (long)value) * 100); // Capitalize first letter return String.Format("{0}{1}", Char.ToUpper(builder[0]), builder.ToString(1, builder.Length - 1)); } }
protected void btnconvert_Click(object sender, EventArgs e) { decimal number; if(!string.IsNullOrEmpty(txtnumber.Text)&& decimal.TryParse(txtnumber.Text.Trim(),out number)) { lblText.Text=NumberToWord.Convert(number); } }
Today I want to work on one project but unfortunately I miss the location where it actually save.so I though when I open visual studio I can find it from Visual studio IDE start page recent opened project list but unfortunately something is change so start page is not loading when I open visual studio IDE it display like
I think for while there should be a setting in visual studio IDE.I start digging on net for few minutes and I found there is a setting in Visual studio menu Tools—>options where we can configure start up page with following six option provided by Visual studio IDE
In above figure you can see a setting like show start up page option. I configure this option for show start up page with recent project list.now I reopen my visual studio IDE and I can able to see visual studio IDE with start up page like
There is another option is also for see recent opened project list like like File—>Recent Projects and Solutions
that’s done from my side.It may helpful to you.Thanks for reading happy coding!!
Thank You
Kirti Darji
Generally one question is faced by very developer what is asp.net page life cycle every body know very well like sequence of asp.net page event like
it is fine for standalone pages but if a page have master page then what the page life cycle? confuse!!!
Below is the sequence of event of page events which contain master page with chronological order.
Remember one thing page life cycle of page contain master page all event fire like first master page event then content page event but in case of page load event first content page load event fire then master page event fire. so that’s all from my side
I think It may help you, Happy coding, stay turned for more…
Thank You
Kirti M.Darji
one of new feature [SessionState] attribute is in MVC 3.0. that can be use for controller Sassion state on ,off or make it read only by using SessionStateBehavior Enum with following choice.
Default - The default ASP.NET logic is used to determine the session state behavior for the request. The default logic looks for the existence of marker session state interfaces on the IHttpHandler.
Required - Full read-write session state behavior is enabled for the request. This setting overrides whatever session behavior would have been determined by inspecting the handler for the request.
ReadOnly - Read-only session state is enabled for the request. This means that session state cannot be updated. This setting overrides whatever session state behavior would have been determined by inspecting the handler for the request.
Disabled - Session state is not enabled for processing the request. This setting overrides whatever session behavior would have been determined by inspecting the handler for the request.
Thank for Reading,
Kirti M.Darji
The Microsoft working on new version of the Visual Studio. The next release will be Visual studio 2012. this is new feature will be available on visual studio 2012
1.Code window resize
2.Edit code while it execute
3.Automatically add semicolons.
4.Advance copy and pasting code
5.Add reference dial
Thank’s for Reading
Kirti M.Darji