|
Thnxs for some sahring some intresting info!
|
|
|
|
|
Thnxs for some sharing some intresting info!
|
|
|
|
|
How to use i frame in asp.net with dynamic height
|
|
|
|
|
set runat="server" id="ifWidth" in iframe tags.
and then write the coding in server side in bellow format
ifWidth.Attribute.add("style","height:350;");
|
|
|
|
|
Hi everyone! I have a page in an e-shop where i would like someone to be able to view his orders. So i want to display data from an orders table in DB using a stored procedure and checking the userid session, so that the user who is logged in can see his orders. Here is my code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="order_id" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="order_id" HeaderText="order_id"
InsertVisible="False" ReadOnly="True" SortExpression="order_id" />
<asp:BoundField DataField="order_date" HeaderText="order_date"
SortExpression="order_date" />
<asp:BoundField DataField="order_value" HeaderText="order_value"
SortExpression="order_value" />
<asp:BoundField DataField="order_status" HeaderText="order_status"
SortExpression="order_status" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:BoardGamesConnectionString %>"
SelectCommand="'OrderInfo'" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="order_id" Type="Int32" />
<asp:Parameter Name="order_value" Type="String" />
<asp:Parameter Name="order_date" Type="String" />
<asp:Parameter Name="order_status" Type="String" />
<asp:SessionParameter Name="UserID" SessionField="UserID"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
Stored Procedure looks like this:
ALTER PROCEDURE [dbo].[Orderinfo]
@order_id int,
@order_value nvarchar(max),
@order_date nvarchar(max),
@order_status nvarchar(max),
@UserID int
AS
Select order_id, order_date, order_value, order_status from Orders Where UserID=@UserID And order_status='Εκκρεμεί'
What am i doing wrong? Thanks in advance!
|
|
|
|
|
Hi Diana,
I hope you are expecting to bind the orders for the particular user based on the Session["UserID"].
Then why you are passing the @order_id, @order_value, @order_date, @order_status to your Orderinfo (Stored Procedure). Okay let it be.
If you think it is necessary to pass those parameter (@order_id, @order_value, @order_date, @order_status) then you have to pass corresponding values for those parameter.
To pass the values for the corresponding parameters you have to create OnSelecting event for the SqlDataSource as below
Quote: <asp:gridview id="GridView1" runat="server" autogeneratecolumns="False"
="" datakeynames="order_id" datasourceid="SqlDataSource1">
<columns>
<asp:boundfield datafield="order_id" headertext="order_id"
="" insertvisible="False" readonly="True" sortexpression="order_id">
<asp:boundfield datafield="order_date" headertext="order_date"
="" sortexpression="order_date">
<asp:boundfield datafield="order_value" headertext="order_value"
="" sortexpression="order_value">
<asp:boundfield datafield="order_status" headertext="order_status"
="" sortexpression="order_status">
<asp:sqldatasource id="SqlDataSource1" runat="server"
="" connectionstring="<%$ ConnectionStrings:BoardGamesConnectionString %>" <b="">SelectCommand="OrderInfo" SelectCommandType="StoredProcedure" OnSelecting="SqlDataSource1_Selecting">
<SelectParameters>
<asp:parameter name="order_id" type="Int32">
<asp:parameter name="order_value" type="String">
<asp:parameter name="order_date" type="String">
<asp:parameter name="order_status" type="String">
<asp:sessionparameter name="UserID" sessionfield="UserID"
="" type="Int32">
</SelectParameters>
Then in the code behind add the below SqlDataSource1_Selecting event
protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
e.Command.Parameters["@order_id"].Value = 0;
e.Command.Parameters["@order_value"].Value = "";
e.Command.Parameters["@order_date"].Value = "";
e.Command.Parameters["@order_status"].Value = "";
}
I hope this one will help you.
Please give your valuable feedback, It will help me in future. ( This my first post).
S. Prince Sagayaraj
|
|
|
|
|
I am trying to use the SmarterStats webservice. Here is the code I am using:
SiteAdminSoap website_stats = new add_website_stats.SiteAdminSoap();
add_website_stats.ConfigLogLocation[] logLocations = new add_website_stats.ConfigLogLocation[1];
add_website_stats.ConfigLogLocation logLocation = new add_website_stats.ConfigLogLocation();
logLocation.FilePath = @"C:\Inetpub\vhosts\website.com\statistics\logs\W3SVC37";
logLocation.FileWildcard = "*.log";
logLocations[0] = logLocation;
website_stats.AddSite3("xxxuser", "xxxpassword", "testUserName", "testPasswordHere", "myFirstName", "myLastName", 1, 333, "www.website.com/mychannel22", "W3Cex", logLocations, @"C:\Inetpub\vhosts\website.users\statistics\logs\SmarterLogDirectory", 0, @"C:\Inetpub\vhosts\website.users\statistics\logs\SmarterExportDirectory", "", -1);
I am getting Cannot create an instance of the abstract class or interface on this line:
SiteAdminSoap website_stats = new add_website_stats.SiteAdminSoap();
kindly help...
Technology News @ www.JassimRahma.com
|
|
|
|
|
That message seems quite clear: SiteAdminSoap is an abstract class or interface so it cannot be instantiated. You need to read the documentation for it.
Use the best guess
|
|
|
|
|
You have to create your own class deriving from add_website_stats.SiteAdminSoap, e.g.
public class MyStats : add_website_stats.SiteAdminSoap
{
public MyStats() : base()
{
}
}
which implements / overrides some functions and properties of the base class.
And then, of course, you have to create an instance of your class instead of that base class:
SiteAdminSoap website_stats = new MyStats();
|
|
|
|
|
I need to know how to attach multiple attachments with a mail dynamically. number of attachments will only been known dynamically only so please tell help me out in this issue
|
|
|
|
|
|
thank you Richard MacCutchan
|
|
|
|
|
Do you already have a function to send out the emails?
|
|
|
|
|
Yes i Have the functions for sending out the mail with just one mail
|
|
|
|
|
|
|
I have the following code in my MVC application to set up Cascading Drop Down Lists:
public ActionResult Index(){
ViewBag.Clubs = db.Clubs.OrderByDescending(c => c.Name).ToList();
ViewBag.Comps = db.Competitions.OrderByDescending(c => c.StartDate).ToList();
ViewBag.Teams = db.Teams.OrderBy(t => t.Name).ToList();
return View();
}
public IList<Competition> GetCompetitionList(int clubid)
{...}
public IList<Team> GetTeamList(int compid)
{...}
[AcceptVerbs(HttpVerbs.Get)]
public JsonResult LoadCompsByClubId(string clubid)
{
var compsList = this.GetCompetitionList(Convert.ToInt32(clubid));
var compsData = compsList.Select(m => new SelectListItem(){
Text = m.Name,
Value = m.Id.ToString()
});
return Json(compsData, JsonRequestBehavior.AllowGet);
}
[AcceptVerbs(HttpVerbs.Get)]
public JsonResult LoadTeamsByCompId(string compid)
{
var teamsList = this.GetTeamList(Convert.ToInt32(compid));
var teamsData = teamsList.Select(c => new SelectListItem(){
Text = c.Division.Name,
Value = c.Id.ToString()
});
return Json(teamsData, JsonRequestBehavior.AllowGet);
}
public ActionResult PlayerList(Team team)
{
if (team == null)
{
return HttpNotFound();
}
var players = from p in db.Sharks_Player
join t in db.Sharks_Player_CompTeam
on p.Id equals t.PlayerId
orderby p.FirstName
where t.CompTeam_Id == team.Id
select p;
return View(players);
}
And this is the .cshtml:
<script type="text/javascript">
$(document).ready(function () {
$("#ddlClubs").change(function () {
var clubid = $(this).val();
$.getJSON("../Players/LoadCompsByClubId", { clubid: clubid },
function (compsData) {
var select = $("#ddlComps");
select.empty();
select.append($('<option/>', {
value: 0,
text: "Select a Competition"
}));
$.each(compsData, function (index, itemData) {
select.append($('<option/>', {
value: itemData.Value,
text: itemData.Text
}));
});
});
});
$("#ddlComps").change(function () {
var compid = $(this).val();
$.getJSON("../Players/LoadTeamsByCompId", { compid: compid },
function (teamsData) {
var select = $("#ddlTeams");
select.empty();
select.append($('<option/>', {
value: 0,
text: "Select a Team"
}));
$.each(teamsData, function (index, itemData) {
select.append($('<option/>', {
value: itemData.Value,
text: itemData.Text
}));
});
});
});
});
</script>
<p>
@Html.DropDownListFor(Model => Model.Clubs, new SelectList(ViewBag.Clubs as System.Collections.IEnumerable, "Id", "Name"),
"Select a Club", new { id = "ddlClubs" })
</p>
<p>
@Html.DropDownListFor(Model => Model.Competitions, new SelectList(Enumerable.Empty<SelectListItem>(), "Id", "Name"),
"Select a Competition", new { id = "ddlComps" })
</p>
<p>
@using(Html.BeginForm("PlayerList", "Players", FormMethod.Get)){
@Html.DropDownListFor(Model => Model.Teams, new SelectList(Enumerable.Empty<SelectListItem>(), "Id", "Name"),
"Select a Team", new { id = "ddlTeams" })<input type="submit" value="Get Player List" />
}
</p>
The DDL's are being populated as expected, However, when I press the submit button, an empty Team object is being passed to PlayerList . How do I reference the SelectedVAlue of the DDL?
I don't speak Idiot - please talk slowly and clearly
"I have sexdaily. I mean dyslexia. Fcuk!"
Driven to the arms of Heineken by the wife
|
|
|
|
|
Good Day
I am using Ajax-manager
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="paymentTypeList">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="paymentTypeList" ></telerik:AjaxUpdatedControl>
<telerik:AjaxUpdatedControl ControlID="tbxChargeAmount" ></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
now this works on Chrome but not in IE, in IE 10 it gives me an error
SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
Accounts.aspx
SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.
Telerik.Web.UI.WebResource.axd, line 9 character 15475
SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.
Telerik.Web.UI.WebResource.axd, line 9 character 15475
SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.
Telerik.Web.UI.WebResource.axd, line 9 character 15475
more Info again
Unhandled exception at line 2610, column 1 in http:
0x800a138f - JavaScript runtime error: Unable to get property 'id' of undefined or null reference
I am using IE10
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
Good Day ,
I found a Solution to my problem , the following change of the property solved my problem.
ScriptManager1.EnablePartialRendering = false;
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
How Can use or see Label or text in Iframe control in Asp.net...!!?
|
|
|
|
|
This is not clear. Can you explain what you are trying to do?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Passed by value to iframe
|
|
|
|
|
FrameParent.aspx
<form id="form1" runat="server">
<asp:Label id="Label1" runat="server" Text="FrameParent.aspx Label1.Text"></asp:Label>
<iframe id="IFrame1" src="TestFrame1.aspx" frameborder="1" scrolling="AUTO" title="TestFrame1" />
<iframe id="IFrame2" src="TestFrame2.aspx" frameborder="1" scrolling="AUTO" title="TestFrame2" />
</form>
TestFrame1.aspx
<form id="form1" runat="server">
<div>
<asp:Label id="Label1" runat="server" Text="TestFrame1.aspx Label1.Text"></asp:Label>
<input type="button" onclick="onShowParentButtonClick();" value="Show Parent" />
<input type="button" onclick="onShowFrame2ButtonClick();" value="Show Frame2" />
</div>
</form>
<script type="text/javascript">
</script>
<script type="text/javascript">
</script>
TestFrame2.aspx
<form id="form1" runat="server">
<div>
<asp:Label id="Label1" runat="server" Text="TestFrame2.aspx Label1.Text"></asp:Label>
</div>
</form>
|
|
|
|
|
i am trying to create a shopping cart, on productdetails page i displaying productid, ProductName, productImage, ProductPrice and Buy Now Button. i have also created a movable shopping cart by using javascript. Now my problem is i am not able to pick the selected items id and send it javascript function for shopping cart. please guide me how to pick the id of the selected item and send it to the javascript function.
Thanks in Advance
|
|
|
|
|
I don't understand your question?
pick up the productID, pick it up from where?
The buy now button?
[edit]
you can try a hidden textbox, use javascript to place the part number in it, and then read the textbox
modified 23-May-13 17:25pm.
|
|
|
|
|