|
An ActiveX control which is not marked as "safe for scripting" cannot be access from script unless you change the security settings.
If you did manage to change it so that it was marked as "safe for scripting", then any site on the internet could use it to wreak havoc on your users' email.
Try creating your own ActiveX control to perform the specific tasks you need, and locking it down to your intranet site:
Per-Site ActiveX Controls (Internet Explorer)[^]
Alternatively, see if you can do what you need with an iCalendar file, which would have the added advantage of working in other browsers and calendars too.
GitHub - rianjs/ical.net: ical.NET - an open source iCal library for .NET[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello, our company website is getting hit hard from malicious bots. I wish to propose a solution which involves changes to our web.config file. The trick is that I wish for the general search engine traffic to continue; I'm just interested in preventing the malicious bots.
This is an example of what I'm seeing online:
http://blog.arvixe.com/how-to-block-malicious-bots-and-spiders-in-web-config
The author seems to be restricting all search engines. Is this correct? If so, does anyone have an alternative that will allow for general search engine traffic to visit but restrict specific malicious bots? (I'd prefer to edit the web.config, since I don't believe that malicious bots care about the robots.txt file.)
Thanks!
|
|
|
|
|
I experimented with that years ago writing a program called bot catcher or something, the program is located in my profile in articles submitted.
Over the years, the bots just change their names over and over and it becomes a circular task that chews up so much time.
I guess to anwser your question, no I have not used the web config or knew that method existed. I'm just saying that manual operation of adding bots to that config is time consuming.
IMHO, the best solution is to just block an entire country using something like a Sonic Wall.
You can create automated programs that will detect and block by IP Address, but the bot activity will detect the block and notify it's master of it; then the master will put your website on a army of machines starting in Russia, then China and so forth. If you keep blocking those, then the army grows till it wraps around the world and it's 24/7.
So after 4 years of experimenting, I finally just broke down and bought a $2K Dell NSA 2600 Sonicwall and purchased a 3 year contract to filter out bad stuff; works like a champ now and they do all the work.
Now I can focus on just writing better more efficient code to keep user data safe.
Globalism is Socialism on a planetary scale.
|
|
|
|
|
Thanks for the reply. I posted my question before understanding that my company is using SonicWALL already, and it is working well.
I appreciate your thoughts about web.config. Too bad there is no way to stop malicious bots that doesn't require spending $$$.
|
|
|
|
|
Hi Professionals,
We have a complex application developed in asp.net web forms and ajax. the Application is very heavy and contains many complex functions. Lengthy (Header/details) forms, Complicated Gridviews and all supported with ajax controls.
the application has been enhanced for the last 10 years to keep it with the latest tehnology and trends.
we are planning to do major enhancement to the application - converting it to HTML5 and jquery/bootstrap
the developers advising to re-develop the application in MVC because it is fully support jquery/callback and bootstrap
I am not sure if we can go to in this direction or not. the current application is event based. most of the events are handled in the server side. for example we have a form with many sections being displayed or hidden based on a selection from multiple dropdowns. for that we are using asp.net panel with visible property.
and we have other screens with gridviews loading huge data (more than 50,0000 rows) and we used the gridview built-in paging and sorting. beside we also have nested grids (Expand/Collapse) for each row of the parent grid
I am not sure if all of these functionalities can be achieved by MVC/Bootstrap.
could you please, advise.
Hussain Mohammed Saleh Attiya
ISP Technical Manager
Atyaf Telcom - Bahrain
|
|
|
|
|
There is literally nothing the can be done in WebForms that MVC cannot do. Your team will just need to be prepared to work more in JavaScript.
The underlying technologies are still exactly the same, the separation of concerns is just more clearly drawn.
It will take time, though.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Nathan Minier wrote: Your team will just need to be prepared to work more in JavaScript.
Why?
|
|
|
|
|
Because that's how event driven controls in are managed on a client system, and MVC does not provide a shake-and-bake ajax-supported event-driven control model.
I mean, is that a trick question?
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Nathan Minier wrote: MVC does not provide a shake-and-bake ajax-supported event-driven control model. MVC does provide all of that, and these are possible, only fact is that we don't use this anymore.
Download the boilerplate template, it contains most of Angular, Bootstrap. What are they?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: Download the boilerplate template, it contains most of Angular, Bootstrap. What are they?
They're JavaScript and CSS, not MVC.NET. That's kind of the point: you have a proper separation of concerns between the server and client processes.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
WebForms supports jQuery, bootstrap etc too. Both webforms and MVC are server-side technologies and contrary to popular belief you don't need javascript to use either of them, and similarly using them does not mean you can't use javascript technologies either.
However you can't really "convert" such an app as you have from a server-side methodology to a client-side one. I think you can maybe re-engineer some things such as, for example, ditching datagrid paging and instead use jQuery to call web methods to return the data as pages and then update the DOM directly. These things are no less possible in webforms than MVC.
The way I see it you can only add these types of enhancements and introduce these techniques a bit at a time, or you can commit to full rewrite the app and take the opportunity to improve it in many areas as I'm sure the app would benefit from this. If you do commit to do that then moving to MVC at the same time would be a good thing to do, but it will involve a complete re-write and there will be a steep learning curve for your team.
However don't think you have to use a certain server-side technology to use a certain javascript framework, as it's all just html.
|
|
|
|
|
The main difference between ASP.NET Forms and MVC (except the strict separation of concerns), is where is your code-behind, if any...
The main concerns you have to look for:
1. Time - MVC is not RAD!!!
2. Separation. While in ASP.NET Forms you could bend the rules and mix layers MVC will break under same conditions, and for that the design/develop cycle must be more precise and time consuming...
3. Knowledge of client side technologies... MVC gives you grate control over the final output of rendering, but it can be a burden as you HAVE TO take care for almost every details for your own...
4. OO? Not really. MVC views can not inherit the same way web forms do, so all the idea of master pages and inheritance must be redesigned...
To make it clear - there is no actually anything will stop you from porting your application, but it will be a big challenge and you and your team will have to learn a lot of new things and ways of doing them...
On a personal note: We are in the middle of a similar process. We are merging an ASP.NET Forms and a Win Forms application into a new - modern web application. We are talking about thousands of pages in the final project...
Our final solution is to write our own framework, that enables developing the same way we used to do with Web Forms, but translates old style code to MVC like... So we actually mixing ASP.NET Forms and MVC in a way that still enables RAD development with full OO, but take advantages of the MVC (modern) based development...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
I'm currently porting my web forms app to MVC at the moment. Started last Jan 20, 2016 and plan to deploy it next Mar 2017. My web app was written in VB, so I had to convert to c# as well.
Best call or decision I ever made. I can't wait to deploy the new app and run it. I thought about all the cool stuff I had already had ending up throwing in the trash and writing even better stuff to replace it.
So now I have the whole setup, EF6, automatic migrations, node.js, bower, gulp, bootstrap, fontawesome; with automatic css, js, image compression on every build, and package updates. I can validate a form off a model or just in JQuery. I save 3 hours now every time I publish a change.
It took me 6 months to really learn all of the above, but now I'm jamming fast creating very functional single page apps and so forth with very reusable code. Once you past the learn curve, your reusable code propels you forward at a very fast rate. I's say I'm 8X faster now than Web Forms.
Those complex headers your asking about, you can write an Attribute "OnActionExecuting" class, that will do your header work, and add the name to the top of the controller Action to run it every time that action is called. I have a bunch of these now, one I use for shopping and checkout for security and to replace the Identity module.
Ajax work is a breeze; for I have an Ajax controller that does nothing but ajax calls, returning a JsonResult; just pure json back.
I don't know about the gridview, but suppose you can write something from scratch, it's just HTML. But HTML5 and Bootstrap has stuff that can replace it.
IMO; wish I would of made the move years ago.
Go for it!
Globalism is Socialism on a planetary scale.
|
|
|
|
|
jkirkerx wrote: My web app was written in VB, so I had to convert to c# as well.
I'm not sure you had to convert it - it's possible to write MVC using VB.NET:
Getting Started with ASP.NET MVC 5 using Visual Basic[^]
But it was probably a good move anyway. Most of the samples you find tend to be in C#, and you'll have fewer people mocking your choice of language.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
More like translate it.
I'm no writing any more VB programs in the future.
much easier to write c# now and faster, less typing.
Thanks Richard!
Oh project is coming along sweet now. Been awhile since I asked for help with MVC, getting much better at it and the whole. Just love this stuff!
Globalism is Socialism on a planetary scale.
|
|
|
|
|
Thanks for everybody. After we viewed your replies. we are still evaluating
Hussain Mohammed Saleh Attiya
Sr. System Analyst
Gulf air - Bahrain
|
|
|
|
|
Hi,
I am part of a MVC Web application that contains a Web API. Unfortunately, as I am new to MVC, could the experts out there help me how to integrate the WebAPI into my MVC please?
Thanks
|
|
|
|
|
Check here if you want to call the API server-side (e.g. from within an MVC controller). If you want to consume it on the client side, you could use AJAX or similar with the API URL.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
sunsher wrote: help me how to integrate the WebAPI into my MVC please? Do you want to access Web API or access it in MVC?
The latter is as simple as calling functions on your API object, former one requires a bit of setups, such as routing configurations etc. Be more specific so we may help you.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hello, I have a web page that is using similar code to a second page that works perfectly. Both pages have listviews. Immediately following the listviews I have datapagers.
Page 1 (the working page), has a listview, and a datapager. I have three fields for this datapager. To simplify things, the first field looks like:
<Fields>
<asp:NextPreviousPagerField ShowFirstPageButton="False" ShowNextPageButton="False" />
It works as expected.
Page 2 also has a listview. I have a datapager. If I leave out any fields for this datapager, the web page renders. (I just don't see any pagination control.)
Here is where I attempt to just add a single field to the datapager:
<Fields>
<asp:NextPreviousPagerField ShowFirstPageButton="False" ShowNextPageButton="False" />
Doing this generates what I consider to be a bizarre, crazy error:
<ERROR>
Control 'DataPager_ctl00_ctl00' of type 'LinkButton' must be placed inside a form tag with runat=server
Huh? Why would trying to add even one field to this datapager give me this error? The code for the listviews and datapagers for both web pages are nearly identical. Where both datapagers are defined I am using the runat="server" directive. The directive for the datapager that isn't working resembles this:
<asp:DataPager ID="DataPager" runat="server" PagedControlID="listview1" PageSize="1" OnPreRender="DataPager_PreRender">
I've got runat=server. If I take away the field (i.e., NextPreviousPagerField) in this datapager the web page renders. Add the field and I get what I consider to be a bizarre error.
Are there any ASP.NET DataPager gurus out there? Thanks.
-- modified 17-Nov-16 10:42am.
|
|
|
|
|
If you're not using a server form (<form runat="server"> ), then you need to set the DataPager 's QueryStringField[^] property.
Without setting that property, it's trying to generate controls that cause a post-back, which requires the pager to be placed inside a <form runat="server"> tag.
When you set that property, it generates a series of HyperLink controls, which don't have to be inside a server form.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks, Richard. I didn't know what was going on. Thanks to your help I do.
Have a nice day! 
|
|
|
|
|
Hi All,
I have Date pickers that are used in date range list, I am using jQuery function to add those selected Data ranges to the list
, now, as user can select the new date range which falls under the same date range that is already selected.
So I want to limit the user from not able to select the date range which is already in the selected date range list. Here is the code I am using the to add the Date ranges to the list, any help
a code snippet, a link or even a suggestion helps me great.
var onStartDateSelect = function (dateText) {
$(this).trigger("input");
if (typeof me.values[daterangeindex] === 'undefined')
me.values[daterangeindex] = {};
fullDateString = $(this).val() + "," + $(this).next().val();
$(this).next().datepicker('option', 'minDate', new Date($(this).val()));
if (fullDateString.length == 21) {
me.values[daterangeindex] = ";" + fullDateString;
daterangeindex++;
var str = fullDateString.replace(/[_\W]+/g, "");
var $wrapper = $(this).parent().parent();
addNewDate($wrapper);
};
};
var onEndDateSelect = function (dateText) {
$(this).trigger("input");
if (typeof me.values[daterangeindex] === 'undefined')
me.values[daterangeindex] = {};
fullDateString = $(this).prev().val() + "," + $(this).val();
$(this).prev().datepicker('option', 'maxDate', new Date($(this).val()));
maxStartDate = $(this).val();
if (fullDateString.length == 21) {
me.values[daterangeindex] = fullDateString + ";";
daterangeindex++;
var $wrapper = $(this).parent().parent();
addNewDate($wrapper);
};
};
var onRemoveClick = function () {
if (lastDateRangeDivId != $(this).parent().attr('id')) {
$(this).parent().remove();
}
};
var addNewDate = function ($wrapper) {
count++;
var tmpHTML = '<div class="parameterFieldResize parameterField" style="width: 160;" id="' + paramName + '_1_Div' + count + '">' +
'<input class="parameterDateRangePicker clearable start" style="width:70px" placeholder="Start" type="text" name="' + paramName + '_1_StartDate' + count + '" id="' + paramName + '_1_Start' + count + '" />' +
'<input class="parameterDateRangePicker clearable end" style="width:70px" placeholder="End" type="text" name="' + paramName + '_1_EndDate' + count + '" id="' + paramName + '_1_End' + count + '" />' +
'<button type="button" style="height:3px; width:1px;text-align: center;vertical-align:middle;background: gray;" id="' + paramName + '_1_Remove' + count + '" class="remove-field"></button>' +
'</div>';
var $newField = $(tmpHTML).appendTo($wrapper);
lastDateRangeDivId = paramName + "_1_Div" + count;
$newField.find('.parameterDateRangePicker.clearable.start').datepicker({
changeMonth: true,
changeYear: true,<br />
onSelect: onStartDateSelect
});
$newField.find('.parameterDateRangePicker.clearable.end').datepicker({
changeMonth: true,
changeYear: true,<br />
onSelect: onEndDateSelect
});
$newField.find('.remove-field').on({
click: onRemoveClick
});
};
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
modified 17-Nov-16 10:47am.
|
|
|
|
|
Hello experts,
I hope someone would be able to help me with this.
I have spent entire yesterday trying to figure this out but it still not working correctly.
When data is sent to PDF using stringbuilder and itextsharp, the results look like this:
http://www.wilogincometax.com/bad.png[^]
As you can see from the picture above, if either Employee Name or the value of Employee Name is longer than the other, the Employee ID and the value are mis-aligned.
I tried using fixed width so I can achieve results like below where both Employee Name and Employee ID are aligned correctly no matter the size of the length.
This is what we would like[^]
I am not having much luck with these two lines:
sb.AppendLine(String.Format("{0, -50}{1, -20}", "" & FullName & "", "" & user & "
"))
sb.AppendLine(String.Format("{0, -50}{1, -20}", "Employee Name", "Employee ID"))
entire code below:
Using sw As New StringWriter()
Using hw As New HtmlTextWriter(sw)
Dim FullName As String = txtFullName.Text
Dim user As String = txtUserName.Text
Dim signedName As String = txtSignature.Text
Dim lDate As String = txtDate.Text
Dim sb As New System.Text.StringBuilder
sb.Append("<table border = '0'>")
sb.Append("<tr>")
For Each column As DataColumn In dtb.Columns
sb.Append("<th style = 'background-color: #ffffff;color:#000000'>")
sb.Append(column.ColumnName)
sb.Append("</th>")
Next
sb.Append("</tr>")
For Each row As DataRow In dtb.Rows
sb.Append("<tr>")
For Each column As DataColumn In dtb.Columns
sb.Append("<td>")
sb.Append(row(column))
sb.Append("</td>")
Next
sb.Append("</tr>")
Next
sb.Append("</table><br>")
sb.Append("<br><br><br>")
sb.Append("<table width='100%' cellspacing='0' cellpadding='0'>")
sb.Append("<tr><td>")
sb.AppendLine(String.Format("{0, -50}{1, -20}", "" & FullName & "", "" & user & "<br>"))
sb.AppendLine(String.Format("{0, -50}{1, -20}", "Employee Name", "Employee ID"))
sb.Append("</td></tr>")
sb.Append("tr><td>")
sb.Append("" & signedName & " <br>Employee Signature")
sb.Append("</td></tr>")
sb.Append("<tr><td>" & lDate & " <br>Date</td></tr>")
sb.Append("</table>")
sb.Append("<br />")
I even tried using Module Extension that I googled up yesterday:
Module StringExtensions
<Extension()> _
Public Function AsFixedWidth(ByVal value As String, ByVal desiredLength As Integer) As String
Return value.PadRight(desiredLength).Substring(0, desiredLength)
End Function
End Module
According to the article, it is used with this
b.AppendFixed(s, 20) but I could not figure out how to fit this into my code.
Everything else works great except this.
Any help is greatly appreciated. Not your problem but this is going LIVE today.
|
|
|
|
|
Hi all,
We have a team that's developing an ASP.Net application, as we are new to ASP.Net MVC application, Changing the Web Configs became difficult while deploying as some times it is messing up for different environments. I want to have better approach for implementing this, I suggested for the Custom Config sections, but somebody from team suggested me that Microsoft in ASP.Net MVC automatically takes care of it by using debug and release config files, is it true. Or is there any better and automatic approach for implementing the publishing or deploying an ASP.Net MVC application without messing up with the Environment.
Please give me some advice, thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|