[Solved] replace the matched expression from string and its next charecter?POST operation

You may want to try out the following regex. Regex101 link ((?:\?.*?&|\?)journey=)[^&]* Try out the following code to replace the value of journey to replacement string url = “http://www.whitelabelhosting.co.uk/flight-search.php?dept=any&journey=R&DepTime=0900″; string newUrl = Regex.Replace(url, @”((?:\?.*?&|\?)journey=)[^&]*”, “$1″+”replacement”); Remember to add the following to your file: using System.Text.RegularExpressions; You can do the same for DepTime using the following … Read more

[Solved] Page_load in asp.net

its main purpose it to do / verify / check things when the page is loading ( one of its start events). this function is being called by reflection when AutoEventWireup is on. solved Page_load in asp.net

[Solved] Error Message is not clear to me

If what you posted is your whole class, you’re missing a curly brace. Exactly as the error message says. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Default2 : System.Web.UI.Page { protected void gettickvalue(object sender, EventArgs e) { Random RandomNumber = new Random(); int n = RandomNumber.Next(1, 9); … Read more

[Solved] Double data insert into database asp.net c#

You have two bad practices going on here. First, you should use sql parameters instead of simply concatenating them; to avoid SQL injection. Read here. Second, don’t do an insert in a HTTP GET (Page_Load). You should do this in a HTTP POST and then redirect to an HTTP GET again (PRG pattern). The reason … Read more

[Solved] Function is not working [closed]

You get zero orders because List<OrderInfo> orders = CommerceLibAccess.GetOrdersByRecent(recordCount); is returning an empty list. It is returning an empty list because: return ConvertDataTableToOrders (GenericDataAccess.ExecuteSelectCommand (comm)); is returning an empty data-table. You’ll have to dig into your data table to figure out why it thinks its empty. (maybe because it is actually empty??) 2 solved Function … Read more

[Solved] How many times a word is present in a web page using htmlagility C#

You could treat the whole page/web request as a string and do something like this: https://msdn.microsoft.com/en-us/library/bb546166.aspx It might not be efficient and it would search CSS classes and everything else but it might be a starting point. Else you need to use the agility pack and scrape through each not and check each bit of … Read more

[Solved] how to perform addition using a textbox [closed]

@user3174595 : I have put in the simple code. its the easiest operation that can be performed. form1.aspx <body> <form id=”form1″ runat=”server”> <div> <asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox> <asp:Button ID=”Button1″ runat=”server” Text=”Button” OnClick=”Button1_Click” /><br /> <asp:Label ID=”Label1″ runat=”server” Text=”0″ ></asp:Label> </div> </form> form1.aspx.cs public partial class addition : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { … Read more