|
<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!
|
|
|
|
|
Well, I actually did not like the idea of changing the width of master page. but that is the only solution I got when I saw HTML source after fighting one whole day. Div will adjust to the page but tr and td they do behave as they want to, though you provide a standard Style for Tr and td.
So I solved this by increasing page width in Site.Master. Any tips or solutions without increasing the Page width are much appreciated.
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
Hi guys, I'm looking for suggestions, I'm trying to find a tree view which allows me to use both client and server side coding on it and it's free
I know the good ones are not free and they shouldn't but i figured someone might have come across one
thanx alot
|
|
|
|
|
How to display youtube like progress bar on page load?
|
|
|
|
|
|
Given: (I am new to web programming)
1. Visual Studio 2013, C# / VB
2. I have a front end C# Web app that handles the UI.
3. The C# page code behind calls a vb class in an external DLL to do the business logic.
4. The VB business class needs to update info on the UI page with status, etc. as it is running so it needs access to the Page.
How do you pass the page to the VB constructor?
I have tried various options as:
C#
VBMain VBM;
VBM = New VBMain(this);
with
VB
VBMain ...
Sub New(pWebCtl as Object)
.
Dim MyLblMsg as System.Web.UI.WebControls.Label = pWebCtl.FindControl("lblMsg")
but MyLblMsg is always nothing.
How do you pass and use the web page?
If I pass the label itself I do get it but would need an UpdatePanel to have it update. (This would be put in once I get the basics working).
How to pass and use web page to an external class?
|
|
|
|
|
What exactly you need.Why you need to pass web page to a class.what you do in the external class with the web page.
if you provide more details of what you want to do and what you are expecting as result ,It will help others to provide you answer.
I think from your web page you want to pass some parameter to your external class method and do some action in that class and the method will return the data to your UI.
If this is correct then explain more detail of your requirement.
|
|
|
|
|
The external class does all the business functions of the app which is basically importing a file into QuickBooks. These files can be large.
At various times we would like to send back some status as Done nn records, nnn to go. Orders=nnn, etc.
The plan was to use the passed form so that the external class could do a
pForm.lblMsg.text = "Done nn records, nnn to go. Orders=nnn, etc." and somehow the UpdatePanel which contains lblMsg would be posted back to the user.
Currently the main page which handles screen ui functions contains a upload control that uploads the file to the server and then invokes the external class via the constructor to process that uploaded file.
The VB business class is very extensive.
If there is a better way please let me know.
|
|
|
|
|
Passing a web page as a parameter to a function seems very clunky. You don't generally pass UI objects as parameters, but instead pass their values. If your DLL needs certain values in order to give certain results, then simply pass it the values it needs, not the entire web form.
Pass the DLL only what it needs in order to give you the results you require.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|
|
I understand that but that is NOT what I need to do.
So are you saying that there is no way to pass the entire page as a parameter???
|
|
|
|
|
No I didn't say you could not pass the web page. I am asking you to clarify why you need to pass the entire web page to the DLL in the first place. Can you please explain why you want to pass a web page to a DLL.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|
|