|
string lbText = ((LinkButton)grvSpeakers.HeaderRow.Cells[i].Controls[0]).Text;
The message suggests that the i index is invalid for the number of cells in the row, or Controls does not contain any items. You need to use the debugger to find out which one is the problem.
|
|
|
|
|
Hi
I have a project developed in ASP.net MVC. Need to print to a receipt printer connected with Network IP. Can you share the code.
Thanks
Jewel
|
|
|
|
|
If the printer is connect to the server, and is available to the user account which your application pool is configured to run as, then you might be able to print to it.
If the printer is connect to the client, then all you can do is issue a window.print(); command in Javascript, and hope that the user picks the correct printer, and that the printed output of the current document matches your requirements.
There is no way to print to a client printer from server-side code, and client-side code deliberately has very little control over printing for security reasons.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Usually you generate a PDF in the correct printer format, present the PDF for download, open the PDF and print.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I had a break in between customer projects and decided to take a stab at upgrading my app from Angular V7 to V10, NetCore V3.1 to V5. Had a hell of a time composing my package.json to not produce any version errors. In my last version of my app I was using ngtools/webpack which seemed to just take care of everything for me. But looking at documentation on the internet, it looks like Webpack is back in style now.
I'm confused on a few things, and thought maybe a passer by may set me straight with some proper info. So I'm suppose put my webpack.config.js file in the root of my .net core project so I can build it using debug. Yet if I want to test my webpack file, it needs to be in the clientapp folder of the root project.
I started writing a new webpack.config.js, and many articles pointed to modifying my angular.json file to run @angular-builders/custom-webpack instead of @angular-devkit/build-angular/@angular-devkit/build-webpack.
Ran into that error on debug and build, "fail, Microsoft.AspNetCore.SpaServices[0], and was wondering if anyone had any insight into this. I do have the modules in node_modules.
fail: Microsoft.AspNetCore.SpaServices[0]
<s> [webpack.Progress] 25% building 32/34 modules 2 active C:\Users\jkirk\source\repos\jkirkerx\jkirkerx\ClientApp\node_modules\babel-loader\lib\index.js??ref--7-0!C:\Users\jkirk\source\repos\jkirkerx\jkirkerx\ClientApp\node_modules\@angular-devkit\build-angular\node_modules\webpack\hot\log.js
I tried a lot of different things, just really need to get straighten out on the base or foundation of webpack, then I can fix one issue at a time.
I upgraded to NetCore 5 and that didn't do anything for the error above. Same thing as NetCore 3.1
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I'm pretty close to solving it now.
Down to 1 error now, Can't find Webpack, and can now clearly see the error in the webpack-dev-server.
I installed done-webpack-plugin to halt on errors and give me a description.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Try from last 1 week not able to refresh Gridview After search function executing please help me any one.
protected void btnSearch_Click(object sender, EventArgs e)
{
if (Txtsearch.Text != "")
{
DataSet ds = new DataSet();
bdm.BiddingID = 0;
bdm.Offset = 1;
bdm.Rows = 10;
bdm.Searchstring = Txtsearch.Text.Trim();
ds = dal.Select_biddingdetails(bdm);
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
////ds.Tables[0].NewRow();
//grdbiddingreport.DataSource = ds.Tables[0];
//grdbiddingreport.DataBind();
//GridView SearchResults = (GridView)grdbiddingreport.FindControl("grdbiddingreport");
//grdbiddingreport.DataSource = ds.Tables[0];
grdbiddingreport.DataSource = ds.Tables[0];
grdbiddingreport.DataBind();
}
else
{
ds.Tables[0].NewRow();
grdbiddingreport.DataSource = ds.Tables[0];
grdbiddingreport.DataBind();
}
}
}
else if (Txtsearch.Text == "")
{
DataSet ds = new DataSet();
bdm.BiddingID = 0;
bdm.Offset = Convert.ToInt32(Session["Offset"]);
bdm.Rows = Convert.ToInt32(Session["Rows"]);
bdm.Searchstring = Txtsearch.Text.Trim();
ds = dal.Select_biddingdetails(bdm);
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
grdbiddingreport.DataSource = ds.Tables[0];
grdbiddingreport.DataBind();
}
else
{
ds.Tables[0].NewRow();
grdbiddingreport.DataSource = ds.Tables[0];
grdbiddingreport.DataBind();
}
}
}
grdbiddingreport.VirtualItemCount = GetTotalCount();
GetPageData(1, 10);
}
-------------------------------------------------------------------------------------------------------View Code
<asp:GridView ID="grdbiddingreport" ShowHeader="true" runat="server" Width="100%" ShowHeaderWhenEmpty="true" class="table table-condensed no-more-tables"
AutoGenerateColumns="false" EmptyDataText="No Data Available..." AllowSorting="true" OnSorting="grdbiddingreport_Sorting" OnRowCreated="grdbiddingreport_RowCreated" AllowPaging="true" AllowCustomPaging="true" OnPageIndexChanging="grddcustomer_PageIndexChanging">
<PagerSettings Mode="NumericFirstLast" FirstPageText="First" LastPageText="Last" NextPageText="Next" PreviousPageText="Previous" />
<PagerStyle HorizontalAlign="Right" CssClass="pagin" />
<Columns>
<asp:TemplateField HeaderStyle-Width="9%" HeaderText="Bidding ID" HeaderStyle-CssClass="gridcolor" HeaderStyle-ForeColor="White" SortExpression="BiddingNo">
<ItemTemplate>
<asp:Label ID="lblBiddingid" runat="server" Text='<%# Eval("BiddingID")%>' Visible="false"></asp:Label>
<asp:Label ID="lblBiddingno" runat="server" Text='<%# Eval("BiddingNo")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Customer Name" HeaderStyle-Width="12%" HeaderStyle-CssClass="gridcolor" HeaderStyle-ForeColor="White" SortExpression="CUstomerName">
<ItemTemplate>
<asp:Label ID="lblcustomername" runat="server" Text='<%# Eval("CUstomerName")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-Width="8%" HeaderText="Date" HeaderStyle-CssClass="gridcolor" HeaderStyle-ForeColor="White" SortExpression="BidDate">
<ItemTemplate>
<asp:Label ID="lbldate" runat="server" Text='<%# Eval("BidDate","{0:MM/dd/yyyy}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-Width="10%" HeaderText="Total Cost" HeaderStyle-CssClass="gridcolor" HeaderStyle-ForeColor="White" SortExpression="BidPriceAmount">
<ItemTemplate>
<asp:Label ID="lbltotalcost" runat="server" Text='<%# Eval("BidPriceAmount","{0:N2}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Created By" HeaderStyle-Width="12%" HeaderStyle-CssClass="gridcolor" HeaderStyle-ForeColor="White" SortExpression="Createdby">
<ItemTemplate>
<asp:Label ID="lblcreatedby" runat="server"
Text='<%# Eval("Createdby")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-Width="20%" HeaderStyle-CssClass="gridcolor">
<ItemTemplate>
<asp:Button ID="BtnProposal" runat="server" Font-Size="Smaller" ToolTip="Get Proposal" OnClick="BtnProposal_Click" Text="Get Proposal" CssClass="btn" target="_blank" />
<asp:Button ID="Btncontract" runat="server" Font-Size="Smaller" ToolTip="Contract" OnClick="Btncontract_Click" Text="Contract" CssClass="btn" target="_blank" />
<asp:Button ID="Btnspecs" runat="server" Font-Size="Smaller" ToolTip="Specs" OnClick="Btnspecs_Click" Text="Specs" CssClass="btn" target="_blank" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:TemplateField HeaderStyle-Width="10%" HeaderStyle-CssClass="gridcolor">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" OnClick="LinkButton1_Click" runat="server"><span style="font-size:15px;font-weight:bold">FINANCIAL SUMMARY</span></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderStyle-Width="10%" HeaderText="Action" HeaderStyle-CssClass="gridcolor">
<ItemTemplate>
<%--<asp:ImageButton ID="btnview" runat="server" ToolTip="View" ImageUrl="~/images/view.jpg" Width="20px" Height="20px" /> --%>
<asp:ImageButton ID="btnedit" runat="server" ToolTip="Edit" ImageUrl="~/images/Edit.png" Width="20px" Height="20px" />
<asp:ImageButton ID="btndelete" runat="server" CommandArgument='<%# Eval("BiddingID")%>' ToolTip="Delete" OnClientClick="return confirm('Do you want to delete?')" ImageUrl="~/images/delete.png" Width="20px" Height="20px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
|
|
|
|
|
You have code to databind commented out. Debug your code and see what happens.
|
|
|
|
|
Not Getting any changes It's not refreshing or not toughing any error when i comment grdbiddingreport.DataBind()
|
|
|
|
|
I can't run your code. You have to. Debug the code and see what is happening.
|
|
|
|
|
Quote: First for companies like Facebook, YouTube, Instagram and
other companies' database processing to report SQL Server
The communication line is given to our web server
User information is available on this server by
user information to access database data or fetch user-related files.
We get to the point where the user posts the files every day
we store On the database of a computer in the internal network
that has a hard drive with a raid strip.
There is a Windows service on this computer whose job is to
distribute the database table data on computers within the network
up to 100 computers for storage and the computer ip stores the
storage in the table of a computer that is to be extracted.
To identify a suitable computer for distributing the file on it,
it looks at the active IP table and, for example,
if there are 10 active computers,
stores it on one of the ten to be taken And returns the IP
to store the record with the ID on the database of that particular computer.
Now you can use the server link to report or obtain files
The id of the file is stored on a table with ip of computer that stored on back to the server and store
on the on table that inner join with table of users
Now, when the user logs in, his data will be accessible.
Having the IP address of the link server and the ID of
the file storage location, the report can be get with dynamic queries
Microsoft sql server and the speed of getting files depends
on how many of network computers
Windows service must clear the data from its table after saving the data on
the SQL Server database to always serve the file senders with
|
|
|
|
|
You seem to have forgotten to ask a question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
this is my answer to this question:i am professional in software programming
Quote: First for companies like Facebook, YouTube, Instagram and
other companies' database processing to report SQL Server
The communication line is given to our web server
User information is available on this server by
user information to access database data or fetch user-related files.
We get to the point where the user posts the files every day
we store On the database of a computer in the internal network
that has a hard drive with a raid strip.
There is a Windows service on this computer whose job is to
distribute the database table data on computers within the network
up to 100 computers for storage and the computer ip stores the
storage in the table of a computer that is to be extracted.
To identify a suitable computer for distributing the file on it,
it looks at the active IP table and, for example,
if there are 10 active computers,
stores it on one of the ten to be taken And returns the IP
to store the record with the ID on the database of that particular computer.
Now you can use the server link to report or obtain files
The id of the file is stored on a table with ip of computer that stored on back to the server and store
on the on table that inner join with table of users
Now, when the user logs in, his data will be accessible.
Having the IP address of the link server and the ID of
the file storage location, the report can be get with dynamic queries
Microsoft sql server and the speed of getting files depends
on how many of network computers
Windows service must clear the data from its table after saving the data on
the SQL Server database to always serve the file senders with
How to distribute the processing load of one system on several systems؟
modified 25-Jan-21 12:12pm.
|
|
|
|
|
This is not the right place to post answers to questions that haven't been asked.
Try fleshing out the description and posting a tip instead:
Code Project Article FAQ[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I post in stack overflow befor post in your site why down my article 3account in stack overflow down my question
|
|
|
|
|
Because you're posting in a forum which is designed for answering other people's questions. But instead of answering someone else's question, you've made up your own question and posted an answer to that.
It's similar to a salesman who knocks on your door to try to sell you a set of encyclopaedias - he obviously won't receive the same welcome as the plumber you called to come and fix your broken toilet.
As I said, if you want to publish this information here, then you need to post it as a tip. There is no equivalent section on StackOverflow, so you can't publish it there.
The other alternative would be to set up your own blog.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Additionally, the downvotes might be related to bad spelling, bad formatting, wrong grammatic and specially with the impression you give, that you don't give a crap about the quality and correctness of your posts.
An don't get me wrong, I can understand if you are not a native english speaker, because neither I am native speaker. But only because you can't speak well a language, it doesn't mean that you can't try to speak that language properly.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I am trying to work on autocomplete using jQuery (using a tutorial from here - link,
The problem is that it works fine when I add the following line:
@{
Layout = null;
}
but when I remove it, I have the error about autocomplete function not being found.Is there way around this? I know that it is related to the scripts conflinct in _layout page, but I don't know how to resolve it and I'd like to have my menu layout.
|
|
|
|
|
You haven't included the required script references properly, or you've included them in the wrong order.
Since we can't see what you've done, we can't tell you how to fix it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I load the script from external file and the order is:
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.0.min.js" type="text/javascript"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js" type="text/javascript"></script>
<link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css"rel="Stylesheet" type="text/css" />
<script src="~/Scripts/selectAuthor.js"></script>
and the script order in _layout:
in the head section:
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
<link rel="stylesheet" href="~/Scripts/bootstrap.min.css">
and at the end of section:
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
crossorigin="anonymous"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
@RenderSection("scripts", required: false)
|
|
|
|
|
You're loading multiple copies of jQuery, which will never work:
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.0.min.js" type="text/javascript"></script>
...
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
...
@Scripts.Render("~/bundles/jquery")
...
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
</script> You're also loading Bootstrap multiple times.
And you're mixing up the MVC5 approach (@Scripts.Render ) with the ASP.NET Core / .NET 5 tag helper approach (asp-append-version , asp-fallback-src ).
Simplify your scripts so that you only load each library once. And pick the correct approach for the framework you're using.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I left layout scripts as they are and didn't touch them. For the script part I took one from tutorials. What would you suggest in the terms of making both work fine? For me it doesn't matter much if it is MVC5 approach or ASP.NET core as long as it works.
|
|
|
|
|
Well, it does matter which approach you use - the @Scripts.Render approach won't work in ASP.NET Core / .NET 5, and the asp-append-version approach won't work properly in MVC5.
(To be precise, the asp-* attributes will be sent as-is in the rendered HTML, and won't have the expected effect in MVC5.)
If you're using MVC5, stick to the @Scripts.Render approach for your bundles, and remove the asp-* attributes from your <script> tags:
Layout:
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
<script src="~/js/site.min.js"></script>
@RenderSection("scripts", required: false) View:
@section scripts {
<script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js"></script>
<link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css" rel="stylesheet" />
<script src="~/Scripts/selectAuthor.js"></script>
}
If you're using ASP.NET Core or .NET 5, use the asp-* attributes instead:
Layout:
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
crossorigin="anonymous"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
@RenderSection("scripts", required: false) View:
@section scripts {
<script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js"></script>
<link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css" rel="stylesheet" />
<script src="~/Scripts/selectAuthor.js" asp-append-version="true"></script>
}
Either way, make sure you only include each library once in the page, and that you include them in the correct order. Check the "view source" option in your browser to view the rendered output to make sure it's doing what you expect.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
It works with the first approach. The only problem is that the dropdown autocomplete menu is not shown directly under the textbox, but rather in the top-left corner.
|
|
|
|