|
But you should be able to bind to an empty list, right?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I haven't used the bind in a long time, I would have to run a test on it.
your probably going to have to add some diagnostic code to see whats happening, like in PHP.
Something is getting unreliable in your code somewhere, it may be the bind and your not binding the 2nd time, thus no records are fetched. Perhaps the bind object is locking up the 2nd or 3rd time around.
Just make sure you have data first before you start jumping around on it.
|
|
|
|
|
Are you sure that this.Players.Fetch(id); returns only after the Players list got filled from the database - i.e. it is not starting a thread to fill the list and returns when the thread was started (but not yet finished)?
|
|
|
|
|
I'm using SqlCommand.ExecuteReader - a synchronous call. The problem is the binding code. I thought I had it fixed but it happened again this morning. Even worse, it NEVER happens on my local machine, only on the deployed web site.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote: it NEVER happens on my local machine, only on the deployed web site. That's the fun we developers have to experience sometimes...
I personally do not like Binding, it is too much "magic" behind the scenes, I prefer to fill the Items collection manually. What about trying that old-fashioned method in this stubborn case?
|
|
|
|
|
Ok, so have a task I need to complete asap. in an existing C# web application I have been asked to create a wizard type page.
(only on this page, the steps are stored in a few tables containing - 1) what the step is, 2) the verbatam, 3) the possible responses)
So the questions are:
how do I dynamically load the controls of the step I am currently looking at.
how do I dynamically read the the values selected to save into a database?
How do I move to the next step?
Help!!!
Thanks!
|
|
|
|
|
|
Hi,
We develop an ASP.Net Web Application an in some pages we need to open a new url with parameters from javascript with input type=button, my problem is when use the
window.open("url?id='2'&name='xyz'");
the parameters key and value are shown in the url and it is less secure, please help me to use any way to pass parameters without show it in the url, or help me to hide the url content if it is possible.
Please help me ASAP.
Thanks All
|
|
|
|
|
Try to change the target of your form in which the button is - all your form elements will be posted the the new page...
<script type="text/javascript">
function buttonHandler()
{
form=document.getElementById('IdOfForm');
form.target='_blank';
form.action='newpage.aspx';
form.submit();
form.action='';
form.target='';
}
</script>
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
You may want to try encrypting the data in the query string values and obfuscate the query string parameters
?dIU=sddsfsdf=&nA=gfhfgh=
|
|
|
|
|
I have developed a web page using asp.net in dream weaver and sql server 2000 but when it comes to displaying the page on a web broswer. it gives the following output. Please help this is my assignment to job a job.
<%@LANGUAGE="VBSCRIPT" AutoEventWireup="true"
CodeBehind="Default.sampl.aspx"
Inherits="WebApplication"
%>
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_asp_STRING
MM_editCmd.CommandText = "INSERT INTO dbo.login (username, pass) VALUES (?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, 60, Request.Form("username")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 201, 1, 60, Request.Form("pass")) ' adLongVarChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "sampl.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<%
Set Command1 = Server.CreateObject ("ADODB.Command")
Command1.ActiveConnection = MM_asp_STRING
Command1.CommandText = "INSERT INTO ( ) VALUES ( ) "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_asp_STRING
Recordset1_cmd.CommandText = "SELECT * FROM dbo.login"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body,td,th {
font-family: Verdana, Geneva, sans-serif;
font-size: 12px;
color: #30F;
}
a {
font-family: Georgia, "Times New Roman", Times, serif;
}
</style>
<link rel="stylesheet" title="Disabled for Preview-in-Browser: css.css" type="text/css" />
<style type="text/css">
form {
font-size: 14px;
color: #009;
}
body{animation:ease-in-out running;
backface-visibility:visible;
background-image:inherit;
font-family:"Times New Roman", Times, serif;
font-size:14px;
alignment-adjust:central;
border-color:#906;
border-image:auto;
appearance:desktop;
clip:rect(top right bottom left);
}
h1
{ font-family:Tahoma, Geneva, sans-serif;
font: signature;
font-size:large;
}
</style>
</head>
<body>
<a name="ASPIRE" id="ASPIRE"></a>
<div> <h1> THIS IS REMARKABLE STEP </h1></div>
<div> <iframe src="images/icon.fw.png"> </iframe> </div>
<hr align="center" size="12" noshade="noshade" color="#CC3300" />
<form name="login" >
<br />
<form action="<%=MM_editAction%>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Username:</td>
<td><input type="text" name="username" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Pass:</td>
<td><input type="text" name="pass" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="SUBMIT" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p>
</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
|
|
|
|
|
That doesn't look like any ASP.NET I've seen; it looks like "classic" ASP with a couple of ASP.NET tags thrown in.
I suggest you go and read the documentation[^], and then start again.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
So... with MVC4 and foreseeable future, you can't use
System.Web.Security.MembershipProvider
And must extend your membership provide by inheriting from:
WebMatrix.WebData.SimpleMembershipProvider
or
WebMatrix.WebData.ExtendedMembershipProvider
I say you can't extend System.Web.Security.MembershipProvider because you'd run into the following error when "AccountController" calls "WebSecurity.Login":
"membership.provider" property must be an instance of "extendedmembershipprovider".
Am I understanding this correctly? You must now use WebMatrix SimpleMembershipProvider? - that System.Web.Security.MembershipProvider is obsolete in MVC space? that it's only suitable for web forms?
What's bothering me is, with SimpleMembershipProvider, you must call WebSecurity.InitializeDatabaseConnection at least once - what if I don't store my users in db? What if I just store my users in simple local csv? or xml file?
I think I found the answer here - new MVC 4.0 AccountController not compatible with old System.Web.Security.MembershipProvider.[^]. Thank you Uncle Soft! I so enjoy learning new patterns, especially when it does the same thing!
The new ASP.NET MVC 4 Internet application template AccountController requires SimpleMembership and is not compatible with previous MembershipProviders
You can continue to use existing ASP.NET Role and Membership providers in ASP.NET 4.5 and ASP.NET MVC 4 - just not with the ASP.NET MVC 4 AccountController
The existing ASP.NET Role and Membership provider system remains supported, as it is part of the ASP.NET core
modified 27-Feb-14 23:26pm.
|
|
|
|
|
We are seeing this error related to an http file transfer request
WCF error, System.ServiceModel.CommunicationException the maximum message size quota for incoming messages has been exceeded.
I've seen several posts related to this message, with the general response of just bump it to the max.
What if you want to force a limit on the file transfer size. We want to allow the user to only transfer files 60MB(62914560) and smaller.
Which setting should be set to 62914560? maxStringContentLength or maxArrayLength?
Is there overhead for the envelope around the request? In other words will the max allowed download file size be 60MB? Or is it smaller, file size + request overhead <= 60MB?
If it is the latter, can this be determined. Is the overhead fixed size? Or is the overhead a function of other settings (eg-maxBytesPerRead)?
Does SSL impact the file (overall message) size? How much?
I'm trying to understand exactly how it works. Changing the size seems arbitrary. How do I know what the correct setting value is to allow downloads of files that are only 60MB or less. One of the things I am seeing is that a zip file of 53776931 bytes will throw the exception. Prior to the download, I'm checking the size of the file and it is clearly less than 60MB. What is causing the message to exceed the maximum message size?
|
|
|
|
|
Hi All,
I had been out for a while in Client side programming. I have a repeater control in which I have 12 text values to show for each month, then I have a label in which I want to display the sum of all these Textbox values for each row.
Means the Text boxes will appear first and in the last I have a label.
I want to sum all these textbox values and put it in the label for each row. And whenever textbox value changes that should change the value of label also.
Can anybody please help in achieving this? I am also searching. If you know any link etc, please help me. It would save lot of my time.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
|
Thanks for your help. But in the examples they are putting the total after all the rows in the footer of the Repeater. I want it on the same row at the end of the row I have a label there I want the sum of all columns of each row.
I am googling, but if you know something please help me.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hi Friends,
I am new user for jQuery and jqGrid. I am trying to implement jqGrid with client side pagination. It is not working at my end. I am using .net 4.0 web service to get json respons.
This is my web service code
public string GetMessage(string FDate,string TDate,string Status)
{
databaseDataContext dc = new databaseDataContext();
var v = (from v1 in dc.WBS_MESSAGEs
where v1.TransStatus == Status && v1.CreatedDate >= fromDate
&& v1.CreatedDate <= toDate
select new
{
v1.MessageID,
v1.Task,
v1.Remark,
v1.CreatedDate,
Object = (v1.ObjectID == "2" ? "Business Partner" :
v1.ObjectID == "30" ? "Journals" : "Unknown")
});
if (v.Count() > 0)
{
System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
return js.Serialize(v.ToList());
}
else
{
return null;
}
}
This is my JavaScript / jqGrid code
function callMessage(p0, p1,p2,ctrlName) {
$.ajax({
type: "POST",
url: "SAPBOne.asmx/GetMessage",
data: '{ "FDate":"' + p0 + '" ,"TDate":"' + p1 + '","Status":"' + p2 + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (data) {
alert(data.statusText);
},
success: function (data) {
var thegrid = jQuery(ctrlName)[0];
thegrid.addJSONData(JSON.parse(data.d));
}
});
};
$(window).load(function () {
var qString = get_query();
jQuery("#jsonmap").jqGrid({
url: callMessage(qString.p0, qString.p1,'Success','#jsonmap'),
datatype: 'json',
colNames: ['Message ID', 'Object', 'Task', "CreatedDate", 'Remark'],
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
colModel: [
{ name: 'MessageID', index: 'MessageID asc', sortable: true, align: "center", width: 55 },
{ name: 'Object', index: 'Object', width: 120, jsonmap: "Object" },
{ name: 'Task', index: 'Task', width: 80, jsonmap: "Task", align: "center" },
{ name: 'CreatedDate', index: 'CreatedDate', jsonmap: "CreatedDate", align: "center", formatter: 'date', formatoptions: { srcformat: 'yyyyMMdd', newformat: 'd-M-y @ H:i:s' }, width: 140 },
{ name: 'Remark', index: 'Remark', width: 300, jsonmap: "Remark" }
],
serializeGridData: function (postData) {
return JSON.stringify(postData);
},
loadtext: "Loading...",
rowNum:5,
rowList: [5, 10],
pager: '#pjmap',
sortname: 'MessageID',
sortorder: "desc",
viewrecords: true,
gridview: true,
loadonce:true,
sortorder: "desc",
sortname: 'MessageID',
caption: "Success",
pgbuttons: true,
height: 'auto',
refreshtext:'Refresh',
repeatitems: true,
emptyrecords: "No records to view"
});
jQuery("#jsonmap").jqGrid('navGrid', '#pjmap', { edit: false, add: false, del: false });
I am stuck here.
Your help will be highly applicable.
s
|
|
|
|
|
|
I am designing an online examination question block which is to be displayed in grid , for which I am using Gridview tool. However , each row contains question number which is to be displayed as columns as given below
Currently it is displaying as
1
2
3
4
But I need this to be displayed as
1 2 3 4
When the user clicks the question number , corresponding question to be displayed in question block
|
|
|
|
|
|
Ha ha if i have to display 100 question do you want me to create 100 tab .......
|
|
|
|
|
Of course you can do that, and then display them ten by ten for example
Light or darkness, we must choose ...
|
|
|
|
|
Hi, I have 'strange' problem with updating received value from another html page:
Supposing I have two pages A and B.
The Page A sent a value (some component with the
name 'selection') by using method Submit in javascript:
Page A
-------
function foo(..) {
...
document.forms["form"].submit();
window.close(); //the page will be closed after sending the value
}
Page B recived the value in the Page_Load:
------
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.QueryString.HasKeys())
{
string navigate = Request.QueryString["selection"];
this.tbValue.Text = navigate;
}
}
The variable 'navigate' has the value sent from the page A thus TextBox.Text is set properly by this value inside the method, but finally is NOT displayed for the client Page B. How to handle this problem of refreshing Textbox so that the value is displayed?
thanks for all useful advice.
|
|
|
|
|
tarzn wrote: document.forms["form"].submit();
window.close();
I assume you're running the script from a popup window. Have you set the target attribute on your form to point to the parent window? If not, you'll be loading Page B in the popup window, which you're then closing.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|