|
It looks like you have more of a JavaScript issue than anything else.
First, remove the onclick handler for the HTML tag, it's extraneous and basically binds a null event to the button I don't see a function fetrec defined anywhere, just an anonymous event handler.
<input type="button" id="BTNFET" value="@model.RecordId" /> <!--
Now for the JS. I'm not 100% sure about best practices with jQuery, and $.ajax() might be a better route, but we'll roll with what you have for the moment:
$('#BTNFET').onclick(function (e) {
$.post('@Url.Action("GetRecordById")',
{
"id": e.target.value
},
function (data) {
$("#txtParti").val(data.Name);
$("#Type").val(data.Type);
});
});
Now, in this context the 'this' object should be the event initiator, but that's not a guarantee. The handler will automatically be passed the event as an argument, though, and we can use that to hook the calling HTML element via the 'target' property. This has the benefit of not leaning on 'this' and therefore not needing to add a new variable into the mix.
|
|
|
|
|
|
Hi all..
I have to compare two text box values whether they are equal or less than or greater than like textbox1.text<=textbox2.text...
I am comparing date as string values..
Thanks in advance..
|
|
|
|
|
|
F-ES Sitecore wrote: to covert the string values in the textboxes into DateTime variables, and you can then compare the DateTime variables using ">>" "<" "==" etc. I would suggest using the
DateTime.Compare Method[^]
My name is Ozymandias, king of kings:
Look on my works, ye Mighty, and despair!
|
|
|
|
|
Why?
The operators[^] return the result of comparing the InternalTicks property for both instances.
The Compare method[^] does almost the same thing, but calculates and returns an integer (-1 , 0 or 1 ), which you then have to test to determine the result. (You also have to remember which value represents which result.)
What benefit do you see in using the Compare method over using the operators, when all you want to do is determine whether one value is less than another?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I did not realize the operator comparison also used InternalTicks.
I learned something today
Put that way, there really is no benefit.
My name is Ozymandias, king of kings:
Look on my works, ye Mighty, and despair!
|
|
|
|
|
|
Hi,
I am using a TextBox in my code and a Panel and some Rad controls in it. When I click a button beside the TextBox it opens the Panel as Popup and when makes change to the fields in the Popup and say Save then Popup closes and TextBox should have the changed value. But TextBox is still showing the old value but when I put mouse over its .text field in the code behind it is showing changed value.
Is there any way I can change the showing value of the textbox as well. I tried in all the events by keeping mouse over every event in code behind shows the changed value but still it doesn't show up in the screen.
Any help is appreciated code snippet, link or even any suggestion, thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Could you post some of the code as it sounds like the one you're expecting to change isn't quite the one that you're looking at in debug.
|
|
|
|
|
Hi,
I am new to the Telerik controls, I am using RadEditor, when I don't put the RadAjaxManager its giving me error like AjaxManager doesn't exist, but when I put in my content page, the error is gone and page loads but it is not enabling the RadEditor to edit the values.
Can anybody please help me in this any link, suggestion or a code snippet would help, I am struggling a little bit and I am also researching to find the reasons for it.
Thanks in advance
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
You'd probably be better off with the telerik forums as they're pretty quick over there, that being said; does it render *anything* at all to the rendered source for the page?
If you could post your code (suitably obfuscated) it'd help.
|
|
|
|
|
Thanks I could able to figure it out, there were not needed elements in the RadAjaxManager.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Can help me about to make online Shopping Website. My query is under:
1. How to add cart
2. how to show product value in repeater (with Image)
3. how to process billing.
4. what is way of return process
Please suggest me my database is in linq (No SQL) so Help me as well as earlier.
Thank You
|
|
|
|
|
You can't learn how to write someone as complex and involved as an ecommerce site from a forum post...you haven't even said what technology you're using. Get a book on c# and one on MVC and go through them and how you do these tasks will become clear (or at least go through some on-line tutorials). You can then ask specific questions about specific tasks if you get stuck.
|
|
|
|
|
LINQ is just a tool in C#, it has nothing to do with data sources. Infact, for LINQ to work, you still need to have a data source for your data objects. SQL Server, NoSQL etc. should all be available for LINQ to work on the collection.
1) Just add a new table which would hold the details for every new order.
Table: Orders
OrderID (int) | UserID (int) | DateTime (Date) | Purchased (bit)
That done, you can now add more items in this. Note that, I am not specifically talking about an SQL table. Instead, I am talking about a "data object" that can store these informations. You can use Entity framework, NoSQL (I have no idea of this!) or plain-text files.
2) There is no such thing as product value. It is the product, and then its value, the amount that has to be charged. That would require plain-HTML code. Just a simple loop. Is that too tough?
3 and 4) Billing would require an eCommerce service, a payment gateway and so on. You should not build it yourself, instead get a third-party service such as PayPal, Skrill or Google Wallet etc. and then allow clients to make a payment. Billing and other return procedures are your own policies. You have to define them yourself as they would be of your interest! You should never ask anyone to build your policies, instead build them yourself. Contact a lawyer or any official or legal personnel and then make up the policies and terms of conditions.
You may mess up with the payment gateways and other services. Trust me, anything that has money involved is a very big lawsuit, and you as a beginner must be aware of that!
Creating a shop website in ASP.NET[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
modified 5-Jan-16 6:28am.
|
|
|
|
|
I am developing desktop-apps. Now I want to go to a web-based approach with asp.net mvc as a framework.
I want to skip the Silverlight-approach and instead want to do it html5-JScript-based (with asp.net mvc).
I do not have such kind of modern high-end-multimedia screens. Instead, my requirement is to keep the "usual desktop like UI" as menues, win-forms, .... for showing things like datagrids
Can you give me some hint how to make the first steps?
Thank you in advance
modified 4-Jan-16 15:46pm.
|
|
|
|
|
Windows 10 theme can be used to build web applications on. Microsoft developed WinJS and released it as open-source project. This can be used, not only to build Windows Store applications but to build web applications too.
The theme of the website would look much like Windows Desktop applications. WinJS is based on the style themes natively in JavaScript and CSS. You can get it, learn more about it and even share it. (Look at the links provided below
WinJS Everywhere | Building Apps for Windows[^]
winjs/winjs-modules · GitHub[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
It's me again.
I created my first asp.net-site, following this link Building your first MVC 6 application — ASP.NET MVC documentation[^]
I have no problem with the "Model-View-Controller"-Pattern, but:
a) I am intimidated by this enormous bunch of tools I had to setup before the project was built successfully
b) there is an endless number of files generated which tells me nothing
Finally:
I am sure, nobody in this world is able to understand what's going on here
|
|
|
|
|
I have a list called List < Accounts > where I can add customers' info after supplying the needed data and clicking the Add button on my webform. To persist my data between postbacks I stored my data in a session variable then retrieve them from that session variable later on.
The problem is the session variable only shows one account even though I added multiple accounts. The folloewng is my code.
List<Account> accts = new List<Account>();
protected void btnShowAccountDetails_Click(object sender, EventArgs e)
{
StringBuilder acctDetails = new StringBuilder();
if (Session["acctObjects"] != null)
accts = (List<acct>)Session["acctObjects"];
foreach(Account acct in accts)
{
acctDetails.Append("ID: "+ acct.Name + " Account ID: " + acct.AccountID + "<br/>");
}
litCtrShowAccountDetails.Text = acctDetails.ToString();
}
protected void btnAddAcctount_Click(object sender, EventArgs e)
{
Account acct = new Account();
StringBuilder acctDetails = new StringBuilder();
if (!String.IsNullOrEmpty(txtName.Text))
{
acct.Name = txtName.Text;
}
else
{
ScriptManager.RegisterStartupScript(this, GetType(), "EmptyName", "EmptyNameAlert();", true);
}
if (!String.IsNullOrEmpty(txtAccountID.Text))
{
acct.AccountID = txtAccountID.Text;
}
else
{
ScriptManager.RegisterStartupScript(this, GetType(), "EmptytAccountID", "EmptytAccountIDAlert();", true);
}
accts.Add(acct);
Session["acctObjects"] = accts;
}
Please help me resolve this issue, thanks in advance.
modified 4-Jan-16 13:23pm.
|
|
|
|
|
You instantiate accts as a new List of Accounts. Then all you do is add 1 account when the button is clicked. So, when you click the button again, the variable is accts is being set as new again.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
The issue is where you add the accts which is a List<Account> to the session.
These two lines of code always replace whatever object present in Session["acctObjects"]
accts.Add(acct);
Session["acctObjects"] = accts;
To avoid the overwrite, whenever you want to add a Account to List<Account> stored in session, get the List from session, add new Account to that list and store it back to session. Here is how you can do it.
if (Session["acctObjects"] != null)
accts = (List<acct>)Session["acctObjects"];
accts.Add(acct);
Session["acctObjects"] = accts;
|
|
|
|
|
Thanks for replying your suggestion is very helpful.
|
|
|
|
|
Slightly pedantic but to avoid your code throwing an error when the session times out I'd code this more defensively
if (Session["acctObjects"] != null)
accts = (List<acct>)Session["acctObjects"];
else
accts = new List<acct>();
accts.Add(acct);
Session["acctObjects"] = accts;
|
|
|
|
|
Alternatively:
const string AcctObjectsSessionKey = "acctObjects";
...
accts = (List<acct>)Session[AcctObjectsSessionKey] ?? new List<acct>();
accts.Add(acct);
Session[AcctObjectsSessionKey] = accts;
That avoids the possibility of the session object being removed between the existence check and the retrieval.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|