|
HI,
I am working on an asp.net web application. I am facing a strange problem while I launch the application. On running the application, while the default.aspx page is launching the address bar of the browser shows URL as : http://localhost:52839/default.aspx , but when the page gets loaded the URL changes to : http://localhost:52839/(S(hp5dkt55qmvwtre0jynebb55))/default.aspx . If you notice "(S(hp5dkt55qmvwtre0jynebb55))" gets added in the previous URL. That means a redirection is taking place when I launch the application. Can you please tell what and why this must be happening. I haven't done any redirection in the page load or any where else in the code behind.
|
|
|
|
|
That looks like a cookieless session[^] URL.
If you're not using .NET 4.5, and you haven't installed the relevant patch[^], it's possible that ASP.NET doesn't recognise IE10/11 as an up-level browser, and is forcing cookieless sessions. Try installing the latest .NET framework patches, or upgrading to .NET 4.5. Alternatively, update your web.config file to force the application to use cookies for all browsers.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
+5
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello, i working with .net.socket and i have a server in vb.net, and client in aspx.vb, i can send all data server to client, and i add a break point and i can check the msg , but i try to show in listview or textbox, or something but i cant show nothing, please i need help,
the server can connect with client and can send msg
the client can receive the msg
but i cant show the msg in listbox or text box
and other question is too about Invoke in winform aplication i can work with invoke for Callback Object, but i dont know as i can do in aspx here a example
If Me.InvokeRequired() Then
Me.Invoke(client.ClientCallbackObject, bytes, dataChannel)
Else
Dim dontReport As Boolean = False
If dataChannel < 251 Then
If bytes.Length < 65535 then
Me.ListBox1.Items.Add(TcpComm.Utilities.BytesToString(bytes))
Else
Me.ListBox1.Items.Add("Received LAT packet containing " & bytes.Length.ToString & " bytes.")
Dim viewer As frmLatViewer = New frmLatViewer
viewer.PassBytes(bytes)
viewer.Show()
End If
|
|
|
|
|
How can I convert .net CLR into Silverlight CLR type
|
|
|
|
|
By modifying the code to meet the requirements of a Silverlight module. But without any more detailed information it is anyone's guess what else is needed.
|
|
|
|
|
hi hi every body ..i cant' understand logic of code...plz help me .Thank you!
class Product
namespace EssentialTools.Models {
public class Product {
public int ProductID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public string Category { set; get; }
}
}
using System.Collections.Generic;
using System.Linq;
namespace EssentialTools.Models {
public class LinqValueCalculator {
public decimal ValueProducts(IEnumerable<Product> products) {
return products.Sum(p => p.Price);
}
}
using System.Collections.Generic;
namespace EssentialTools.Models {
public class ShoppingCart {
private LinqValueCalculator calc;
public ShoppingCart(LinqValueCalculator calcParam) {
calc = calcParam;
}
public IEnumerable<Product> Products { get; set; }
public decimal CalculateProductTotal() {
return calc.ValueProducts(Products);
}
}
}
}
modified 4-Jan-15 3:31am.
|
|
|
|
|
Please do not post the same question in two different forums.
«A man will be imprisoned in a room with a door that's unlocked and opens inwards ... as long as it does not occur to him to pull rather than push» Wittgenstein
|
|
|
|
|
i am sorry.Thank you bro!
|
|
|
|
|
Hello Experts,
Happy New Year!
I have a dynamic Grid view which generates rows dynamically. I also have a dropdown in Gridview. On ddlselectedvalue="File" create a new column for existing gridview where user should upload a file and that file should be saved in ASP.NET application "Files" folder.
Can anyone please help me with this. Working on this since two days.
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
<asp:GridView ID="gdvItems" runat="server" Visible="true" ShowFooter="true" AutoGenerateColumns="false">
<Columns >
<asp:BoundField DataField="ItemNo" HeaderText="ItemNo" />
<asp:TemplateField HeaderText="TireSize">
<ItemTemplate>
<asp:TextBox ID="txtTireSize" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DOT">
<ItemTemplate>
<asp:TextBox ID="txtDOT" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RemovalArea">
<ItemTemplate>
<%--<asp:TextBox ID="txtReAre" runat="server"></asp:TextBox>--%>
<asp:DropDownList ID="ddlRemovalArea" runat="server" OnSelectedIndexChanged="ddlRemovalArea_SelectedIndevChanged" AutoPostBack="true">
<asp:ListItem>-Select-</asp:ListItem>
<asp:ListItem>Bead</asp:ListItem>
<asp:ListItem>Tread</asp:ListItem>
<asp:ListItem>Sidewalk</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
<asp:ListItem>Tread life</asp:ListItem>
<asp:ListItem>Interior</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TirePosition">
<ItemTemplate>
<%-- <asp:TextBox ID="txtTireposition" runat="server"></asp:TextBox>--%>
<asp:DropDownList ID="ddlTirePosition" runat="server">
<asp:ListItem>-Select-</asp:ListItem>
<asp:ListItem>Left Front</asp:ListItem>
<asp:ListItem>Right Front</asp:ListItem>
<asp:ListItem>Left Rear</asp:ListItem>
<asp:ListItem>Right Rear</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
<asp:ListItem>Trailer</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText ="32nds">
<ItemTemplate>
<asp:TextBox ID="txtDepth" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText ="Product Code">
<ItemTemplate>
<asp:TextBox ID="txtProductCode" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Reason for Removal">
<ItemTemplate>
<asp:TextBox ID="txtRR" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ApprovalNumber">
<ItemTemplate>
<asp:TextBox ID="txtApprovalNumber" runat="server"></asp:TextBox>
</ItemTemplate>
<FooterStyle HorizontalAlign="Right" />
<FooterTemplate>
<asp:FileUpload ID="FileUpload" runat="server" />
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField>
<FooterTemplate>
<asp:Button ID="ButtonAdd" runat="server" Text="Add New Row" onclick="BtnNewRow_Click" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Here is my ASPX code , to make you understand what I need.
On ddlRemovalArea="Tread life" then upload file is Required. else not required. And if uploaded file it should give a image in the last column like Attachment.
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
|
i want add next page to current page at the bottom while scrolling
|
|
|
|
|
i used telerik component
this is my code:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<ClientEvents OnRequestStart="onRequestStart" />
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="FormLoading" />
<telerik:AjaxUpdatedControl ControlID="Lbl_Msg" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="tree_Image" EventName="SelectedNodeChanged">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="FormLoading" />
<telerik:AjaxUpdatedControl ControlID="Lbl_Msg" />
<telerik:AjaxUpdatedControl ControlID="tree_Permit" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
html:
<telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" >
<MasterTableView>
<Columns>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="SaveImage" HeaderText="saveImage"
ImageUrl="~/images/saveImage.png" HeaderTooltip="saveImage" UniqueName = "SaveImage" >
</telerik:GridButtonColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="ViewImage" HeaderText="viewImage"
ImageUrl="~/images/openImage.png" HeaderTooltip="viewImage">
</telerik:GridButtonColumn>
<telerik:GridBoundColumn HeaderText="(Byte)imageSize" DataField="Size" UniqueName="Size">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="imageName" DataField="Files" UniqueName="Files">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="location" DataField="parentFolder" UniqueName="parentFolder"
Display="false">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings EnablePostBackOnRowClick="false">
<ClientEvents OnCommand="OnCommand" />
</ClientSettings>
</telerik:RadGrid>
\\\\\
Protected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
Try
If e.CommandName = "SaveImage" Then
Dim FileName As String = RadGrid1.Items(e.Item.ItemIndex).Item("Files").Text
Dim parentFolder As String = RadGrid1.Items(e.Item.ItemIndex).Item("parentFolder").Text
Dim size As String = RadGrid1.Items(e.Item.ItemIndex).Item("Size").Text
Response.AddHeader("Content-Disposition", "attachment;filename=" & FileName)
Response.AddHeader("Content-Lenght", size)
Response.ContentType = "application/octet-stream"
Dim Url As String = parentFolder & "\" & FileName
ScriptManager.GetCurrent(Me).RegisterPostBackControl(RadGrid1.Items(e.Item.ItemIndex).Item("SaveImage"))
Response.WriteFile(Url)
Response.End()
Else
BindGrid(tree_Image.SelectedValue())
End If
Catch ex As Exception
'ShowException(ex.Message, MultiView1.ActiveViewIndex)
Lbl_Msg.Text = ex.Message
End Try
End Sub
but when i click "saveImage" button in grid i get this error : Control with ID '' being registered through RegisterAsyncPostBackControl or RegisterPostBackControl must implement either INamingContainer, IPostBackDataHandler, or IPostBackEventHandler
|
|
|
|
|
Take the code out of the button click and try it again.
If it fails, then your problem is isolated to the button click handler,
If the code runs, then your problem is isolated to the code your pasted in your button click.
It can't be both, it's one of the other.
Since your didn't post the ID of the Control that generated the error, can't really help you on that. It's really a Telerik issue, you should use there forum. They wrote it, and it looks like a cut and paste job to me, in which you just sort of took a guess at saving or displaying the image. I use of the response object make no sense to me at the moment.
To write a file, you use IO.file and write the stream to the hard drive as a file.
[FYI]
You can wrap your webform markup in tags such as <pre></pre> to retain the formatting.
|
|
|
|
|
Hi,
I'm using cms nopecommerce opensource using ASPNET
I have problem this :
Language in page is not problem,when I view page source , I see
<meta name="description" content="mua bá#" />
It's not correct my VIET NAM language,i'm afraid it's not good for SEO .Google,Bing will not know this is VIET NAM language
I want to fix it like this :
<meta name="description" content="mua bán" />
How must I fix it ?
Thank you very much for helping me.
HAPPY NEW YEAR.
|
|
|
|
|
|
thanks so much,jkirkerx.I had solved this problem.
|
|
|
|
|
hello sir
i have using both fancy box and jquery paging in my project
,first i had pluged fancy box its worked fine,second i pluged jquery datatable paging for gridview, now both are not working
i checked the plugins all are correct, I DONT KNOW why its not working
muniraj
|
|
|
|
|
Well the later broke the first, that happens quite often with jquery plugins.
Something in the 2nd plugin is conflicting with the first.
If you run the web page in IE11, press F12, and select debug, the picture of the insect(bug), the debugger will stop in the error that is crashing the DOM.
Unless you wrote the plugin, it would be quite hard to fix it. So find the error, and try something else for the gridview, or decide which one of them your willing to give up.
|
|
|
|
|
|
I'm working on a project in ASP.NET MVC, using Entity Framework 4 Code-First. The project uses the generic Repository pattern. I have an entity called "Tag", and "Tag" has a relation to entity "Right" (which is a collection). It looks like this:
public class Tag
{
public Tag()
{
this.Rights = new List<Right>();
}
public string Name { get; set; }
public virtual ICollection<Right> Rights { get; set; }
}
In the Tag controller, there is an action method for "Edit", similar to this (modified for simplicity):
public ActionResult Edit(Tag entity)
{
var rights = _rightsRepository.Get(r => r.IsActive == true).ToList();
entity.Rights = rights;
Repository.Update(entity);
UnitOfWork.Commit();
return View("Index");
}
* "_rightsRepository" is "IRepository<right>", which, using Dependency Injection, goes to "Repository<right>" (generic Repository pattern).
There is a Mapping class set up for Tags and Rights, and the mapping is setup like this:
this.HasMany(t => t.Rights)
.WithMany(r => r.Tags)
.Map(m =>
{
m.ToTable("Tag_Right_Relation");
m.MapLeftKey("RightId");
m.MapRightKey("TagId");
}
When debugging and setting a breakpoint in the "Edit" action method, I can step through, and the "Tag entity" has its property "entity.Rights" set accordingly, with the correct list of "Rights". However, when the actual update is called, the "Rights" collection is not persisted.
However, when using a single database Context (e.g. "MyAppContext"), it saves properly. We have a similar relation set up for the entities "User" and "Role". It maps to "User_Role_Relation". That relation uses the exact same type of method for the Tag_Right_Relation above. The Tag_Right_Relation does not work. The User_Role_Relation DOES work.
Why is it not working with objects from two different contexts for one entity type, but for another it does?
EDIT:
---------------------------
For whatever reason, it appears that the "Tag" entity is being disconnected from EF between the "Edit(int?)" action method, and the "Edit(Tag)" method. If I retrive the Tag entity from the Repository in "Edit(Tag)" and update the "Rights" collection, it works. Why is that? In other areas of the application, we don't have to do that.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
We are building a transportation services website that allows potential users to make transportation services requests online.
We provide the following services:
ONE WAY trip TO the airport
ONE WAY trip FROM the airport
Round Trip services
Also, users have options of what type of vehicles to use.
The vehicles include Sedan and SUV
The way it is supposed to work is this:
If trip is ONE WAY, user is charged a certain fare.
If Round Trip, the user is charged double the ONE WAY fare.
Each fare includes a 10%, a 7% tax and a 20% tip.
If preferred vehicle is SUV, there is an additional $12.00 added to the overall cost.
The code I have below captures the initial fare correctly.
It captures the discount amount, the tax amount, the tip amount, $12.00 for SUV(if that's user's preferred vehicle) and it captures the overall total cost.
The problem we are having is that it does not capture the round trip total cost.
or instance, if overall cost for one way trip from Calhum to airport is $75.00, we expect the round trip be twice that amount for the same route.
Any ideas what to fix on my code to make it work correctly?
Dim StrSQL As String = ""
Dim strWHERE As String = ""
Dim rs As SqlDataReader
Dim val As String = tripType.SelectedItem.Value
Dim suv As String = vpreferred.SelectedItem.Value
'Response.Write(val)
'Response.End()
If val = "hourly" Then
StrSQL = "select DISTINCT s.carTypes, s.Newfare as Fares, s.tip, (s.total+^SUV^) as total from vwhourly s "
strWHERE = " WHERE s.Hourly = @hourly"
If Len(suv) <> 0 Then
strWHERE += " AND s.carTypes = '" & suv & "'"
End If
Else
' StrSQL = "SELECT city, fare, (fare*(10/100)) AS Discount, (fare-Discount) * ^RT^ AS NewFare, (Newfare*(7/100)) AS tax, (newFare*(20/100)) AS tip, (Newfare + (Newfare*(7/100)) + (newFare*(20/100)) + ^SUV^) AS total FROM Rates "
StrSQL = "with CTE_Rates as " & _
"( " & _
" Select DISTINCT " & _
"City, " & _
" Fare " & _
" FROM Rates " & _
") " & _
"SELECT " & _
"City, " & _
"Fare, " & _
"Fare * 0.1 AS Discount, " & _
"(Fare * 0.9) * ^RT^ AS NewFare, " & _
"Fare * 0.063 AS Tax, " & _
"Fare * 0.18 AS Tip, " & _
"Fare * 1.143 + ^SUV^ AS Total " & _
"FROM CTE_Rates "
strWHERE = " Where city In('" & lblPreviewfromCityState.Text & "' , '" & lblPreviewDropOff.Text & "')"
End If
If suv = "SportUtilityVehicle" Then
StrSQL = Replace(StrSQL, "^SUV^", "12")
Else
StrSQL = Replace(StrSQL, "^SUV^", "0")
End If
If val Like "round_trip_*airport" Then
StrSQL = Replace(StrSQL, "^RT^", "2")
Else
StrSQL = Replace(StrSQL, "^RT^", "1")
End If
Dim conn As New SqlConnection(connStr)
Dim cmd As New SqlCommand(StrSQL & strWHERE, conn)
If val = "hourly" Then
cmd.Parameters.AddWithValue("@hourly", HourlyCharter.SelectedValue)
End If
Response.Write(StrSQL)
Response.End()
'Now open connection to the db
conn.Open()
'open recordset to receive db values
rs = cmd.ExecuteReader()
While rs.Read()
Dim tipValue As Decimal = rs("tip")
Dim totValue = rs("total")
Dim tp As String = [String].Format("{0:C}", tipValue)
Dim tot As String = [String].Format("{0:C}", totValue)
lblTip.Text = tp
lblTotal.Text = tot
End While
|
|
|
|
|
Hi All,
I am using Terelik Gridview control and able to get data. As my requirement is get value and Sum the value from "GridAggregateFunction.Sum" property. Then after I need to get the percentage in new column. Please let me know, how to added the new column to already existing Gridview and then how to get the percentage value to newly added column.
Example : Total: 1200 Percentage:480 <- (1200 *0.40)
I am using VB.net.
Please help me.
Thanks in Advance.
JohnDas
|
|
|
|
|
Hello Experts,
I have a gridview which is dynamic row generator. meaning, it generated each row dynamically. My Gridview has 8 Columns. I am using ASP.NET and when it was 7 columns everything seems to be perfect. there are no styles for my Grdiview. There is Style for Content place holder which is generated by VS2010. Now that I added new column to Gridview, 8th column is out of content place holder. Please save me from this silly issue.
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|